On paper, everything about The DUFF seems calculated to make it seem like the most dire of slogs, beginning with its capitalisationally overdetermined, visually ugly title. And it only gets worse upon learning that said title is a slang term (which feels like it probably doesn’t actually exist in the wild) meaning Designated Ugly Fat Friend, and that it is in reference to a character played by Mae Whitman, who could only conceivably be accused of being ugly or fat accordingly to the dysfunctionally narrow range of acceptable female body types allowed by Hollywood.

Surprisingly, if not out-and-out miraculously, The DUFF is not at all the ungainly miscarriage it seems like it not merely could have been, but that, in fact, it absolutely had to be. It is, in fact, a rather intelligent high school comedy, not entirely flawless, and clearly the work of grown-up filmmakers trying to fake it like they know more than they actually do about how The Kids These Days use the Twitter and the Snapchat and the iPad (and then, to cheat even more, they build a totally helpless and out-of-touch school principal into the plot, played by the always-excellent but under-used Romany Malco). But it’s got strong bones and snappy dialogue, and it feels more aware of how people behave (if not specifically teenagers, necessarily) than most of its genre. It’s the best such film I’ve personally seen since Easy A, a film it copies in several particulars: it’s neither squeamish nor prurient in its acknowledgement that teenagers have sex, it relies on well-positioned adult character actors - Malco, Allison Janney, even the usually insufferable Ken Jeong in an unexpectedly grounded career peak - to help build a frame around its game but green young cast, and it’s ultimately built on the bedrock of a magnificent, perfectly-timed comic performance by a woman who almost entirely by herself makes the entire film more sophisticated than it xis, if you follow me. And if The DUFF can do for Whitman’s career what Easy A did for Emma Stone’s then it is a valuable motion picture, indeed.

The basic concept at the heart of the film is that Bianca Piper (Whitman) is disgusted by the thought, presented by her asshole jock neighbor Wesley Rush (Robbie Amell) that she is the “DUFF” of her trio - not, herself, ugly nor fat, but far less attractive than her BFFs Casey (Bianca A. Santos) and Jess (Skyler Samuels), and thus the one who acts as gatekeeper to all the boys who really want to ask one of them out. And this disgust turns into a passionate desire to reinvent herself, and in so doing gin up the confidence to finally approach her crush, Toby (Nick Eversman). Thus she makes a deal with Wes: if he helps her to be less of a doormat, she’ll help him to not flunk out of chemistry. And so they become constant companions and friends, earning Bianca the wrath of Wes’s on-again, off-again girlfriend Madison (Bella Thorne), the most popular but also the cruelest girl in school.

It doesn’t take too long to figure out the overall shape of the thing if not every specific detail it takes to get there, but originality is not generally the goal of romcoms. And whatever lack of suspense enters the proceedings the instant we realise that Wes is transparently crushing on Bianca, the film survives it without too much strain, partially because the actors have the right kind of chemistry in the right directions, and because screenwriter Josh A. Cagan, adapting Kody Keplinger’s novel, wisely takes the more Hitchcockian tack of making the tension within the plot about the characters figuring out what we already know, instead of trying to pretend that we haven’t already heard this one and have no idea what’s going on.

The result is a likable, unchallenging, but largely satisfying number about people who work well together figuring that fact out, while also making the important (if resoundingly clichéd) discovery that being yourself matter more than wedding yourself into a role that society has decreed. The path by which this is navigated has perils, and film struggles through some of them: the whole third act keeps tripping over gooey, film-killing pauses to re-word the final speech from The Breakfast Club around the basic idea that everyone is somebody else’s DUFF. And we know that the film is aware of The Breakfast Club, which was referenced and re-worked to much better effect in the opening sequence, which attempts to ironically grapple with the way that 2010s teenagers filter their identity through the pithy, sound-bitey culture of social media (which, again, feels like adults are responsible for it, not anyone who actually knows a teen; though there’s an extended riff on the word “amassable” that’s pretty delightful). So the film begins and middles far better than it ends: the comedy is spritelier, the visuals and use of graphic elements far more inventive, and the pace breezier. Director Ari Sandel is good at comedy and snark, and not so good at heart. But if we were to throw out every movie that had a rocky ending, we’d hardly have any left.

And for the most part, The DUFF is a top-notch midwinter treat: visually creative in the way it literalises social network technology, given a comfortable assortment of good lines, just twisty enough in its predetermined romcom march that it doesn't feel lazy. And Whitman is a treasure: able to make wretched self-pity seem funny, and self-confident enough in her carriage and expressions - not a trace of Ann Veal to be seen - that she manages to put an ironic spin on being thought ugly or fat, and thus saves the movie from any feeling of toxicity on that front. She's absolutely terrific, giving a wry, knowing attitude to her character and the film, and turning The DUFF from a modestly amusing comedy to a genuine success. It's not perfect, but it's goddamn close for February.