Jake Kasdan's "Bad Teacher" does not always connect with every joke, and there's one character in particular that seems to have been abandoned by the screenwriters midstream, but when the film works, it contains some wicked belly laughs, and I'll give Cameron Diaz credit for this:  she seems delighted to play a total asshole.

And why not?  There's something liberating about playing someone who is absolutely unrepentantly awful.  Elizabeth Halsey is not a reluctant educator who wakes up to her gifts over the course of the film.  She's not someone who loves kids but is afraid to show it.  She's not a good person who is misunderstood.  She's selfish and a little bit stupid and completely superficial, and she sees her teaching job as, at best, an inconvenience, and at worst, a form of torture.  She does not love her students… in fact, she can barely stomach them.  She has one goal in life after being dumped by the man of her financial dreams:  get a tit job so she can hook a big fish.  She figures that's all she's missing, and she's willing to do a year of penance in public high school to get there.

Cameron Diaz tucks into the role like she's a starving person sitting down to a buffet.  When Diaz does good work, it seems like she's asked to do very particular things, and I think with "Bad Teacher," I've finally got it figured out.  Because I like Diaz in certain roles.  I think she can be quite effective.  I think she's got strong comic timing, and I think she's very aware of herself as part of the joke.  When she's playing to her best ability, she is often playing someone who seems to almost be discovering the world as she moves through it.  In "The Mask," her debut, she just seemed surprised to be on a film set and somewhat delighted by the whole thing.  I wouldn't call it a great performance, but the reason everyone wanted to hire her at the end of the film is because she just plain made it look like she was having the best time ever onscreen.  A friend of mine, the great Henchman Mongo, once described Jeff Goldblum's acting style as always looking like Goldblum just walked into a surprise party being thrown for him.  Since then, I can't look at a Goldblum performance without seeing exactly that.  And with Diaz, she looks like someone who is ready to dive in and be part of the joke, someone who is delighted by what you've just asked them to do, and that's what she is doing in "Bad Teacher."  She relishes every rotten thing she's asked to do, that insanely wide Joker smile firmly in place.

The script by Gene Stupnitsky & Lee Eisenberg is good, but a little bit of a shambles.  I wish they'd taken at least one more run at it regarding one character in particular, the one played by Justin Timberlake.  There's a fairly big cast here, including Lucy Punch, Jason Segel, the great Phyllis Smith from "The Office," John Michael Higgins, Dave "Gruber" Allen… all funny people.  All of them are given good stuff to play, and they all rise to the occasion.  Timberlake seems game to play with them all, and I can't fault him at all for the work he does.  There's one moment in the middle of the film involving the most disturbing end to a date I can imagine that makes me applaud Timberlake.  The guy really is happy to look like a total freak.  But his storyline hits a dead end before it's over, and it's like they never figured out how to resolve what they did with him.  It doesn't ruin the film, and it didn't anger me.  It's just a confusing bit of writing that could have worked better, and if they'd figured it out, Timberlake's work would be better showcased.

As it is, Lucy Punch is going to divide viewers with her work as Amy Squirrel, the oh-so-tightly-wound teacher across the hall, sweet as pie on the surface and deep, deep crazy underneath.  If you're going to have a main character who so gleefully doesn't give a crap, you have to have a foil for them who absolutely dedicated to giving a crap.  That's Amy Squirrel.  She thinks of herself as a great teacher, but the truth is she's a maniac, waaaaaay too invested.  And Elizabeth crawls under Amy's skin right away, so the entire film is just this ticking clock as they compete, not only for the attention of substitute teacher Scott Delacorte (Timberlake), but also the basic principle of how to teach.  Amy is determined to expose Elizabeth as a pot-smoking, swearing, hard-drinking fraud, and Elizabeth is like Bugs Bunny, constantly frustrating her attempts to do so.  I like Jason Segal as gym teacher Russell Gettis, watching it all from the sidelines, occasionally letting Elizabeth know how smitten he is, but happy just to take it in.  And Smith, so funny on "The Office," is basically just playing a riff on Phyllis here, but so what?  She's a very funny sidekick for Diaz, and they have some nice moments together.

Technically, the film's well-made, but I'm a little surprised every time I remember it's Jake Kasdan.  His first film was such a great eccentric little number that I think I expected him to be a different filmmaker.  I like him.  I like "The TV Set."  I think "Walk Hard" is underrated.  I even think "Orange County" has its moments.  But when you kick off your career with "Zero Effect" and a whole bunch of season one of "Freaks and Geeks," you set the bar pretty high for yourself.  What seems to distinguish his work is the loose and easy chemistry displayed by his casts, and by the shaggy sort of energy he brings to the films.  Alar Kivilo is sort of a specialist in that bright and shiny studio movie look as a cinematographer, and he makes this one look like a pop cartoon, exactly as it should.  It's good work all around, and while I think the film is sometimes a little too loose, a little too undisciplined, I think it ultimately lands most of its punches.  "Bad Teacher" is, for the most part, pretty good.

"Bad Teacher" opens everywhere June 24, 2011.