Just because it’s dumb doesn’t mean it’s necessarily stupid.

Get Hard, the directorial debut of Men in Black III and Tropic Thunder writer Etan Cohen and the first union of comic heavyweights Will Ferrell and Kevin Hart opens in wide release Friday. It’s attempted blend of class commentary and lowbrow humor doesn’t work all the time, but does manage to pull together enough laughs to be worthwhile.

James King (Ferrell), a wealthy hedge fund trader living in Bel Air with a stunning fiancee (Alison Brie), has it all. Darnell Lewis (Kevin Hart), a lower-middle class car wash attendant/owner at James’ office, does not. Darnell needs $30,000 for a down payment on a house so he can move his family out of “Lower South Central”. King needs nothing and ignores Darnell’s pleas to help him out.

That is until King is accused of falsifying his trading records and various other counts of fraud that see his being sentenced to 12 years in San Quentin. In a panic, King agrees to pay Darnell $30,000 to help him train for prison life by toughening him up and showing him the ins and outs of life on the inside.

Darnell, of course, has never actually been to prison, but that doesn’t stop him from devising an outlandish training regimen that will get King “hard” in the 30 days he has left before his sentence begins. Unfortunately for Darnell, King may be too soft for anybody to prepare adequately for prison.

Get Hard is a lot of different things. It’s a failed examination of class and race in America. It’s abhorrently lewd and immature at times. It’s completely out of touch with our age and its audience. It’s also pretty funny at times.

Yes, despite the film’s repeated insistence on leaning on stereotypes and homophobic humor, it does find enough in its characters and the interplay between Ferrell and Hart to overcome what bogs it down. Ferrell’s King is a solid comic creation harkening back to Dan Aykroyd’s work in Trading Places. A completely spineless WASP, King allows Ferrell plenty of leeway to develope some very Ferrell comedic moments and he doesn’t miss an opportunity be it making a creepy-happy war face or just showing his bare butt.

Hart remains the Kevin Hart character and his manic energy works well as a foil to Ferrell’s uptight King. Together they manage to develop enough gags and moments to make this a memorable comedy, thoug not either of the duo’s best.

The film finds plenty of flaws in its obsession with sodomy humor (there’s at least three larger set pieces built around it) and racial sterotyping (see the picture above), but when these two comedy stars are in a groove a lot of that fades into the background as their characters take over and watching them work just becomes a pleasure. It’s even enough to ignore the pretty ridiculous premise of the film or the featherweight mystery plot that’s largely ignored until it becomes useful as a third act. Just watching the Ferrell and Hart work for 100 minutes is reason enough to head to the movies and this film doesn’t let too much of the movie get in their way.