“I don’t give a shit about anything, yet I simultaneously have an opinion on everything, even topics I’m not informed about,” says Hannah Horvath, the protagonist of HBO’s Girls, in the first episode of the sixth and final season. If Hannah has ever summed herself up in a sentence, then this might be it. Narcissistic, flippant, witty, and cripplingly self-aware, Hannah (Lena Dunham) is an embodiment of the “millennial” temperament. She has high expectations, dwindling self-esteem, and no salary. She wants to have her voice heard, even if she has nothing to say. In an environment where opinions abound freely on the internet, she struggles to find work that either pays or satisfies, and so channels her energies into doing “writerly” things instead.

In the first five seasons, audiences watched as Hannah blundered her way through her twenties: sticking an earbud all the way into her cochlea, making (rebuffed) advances on her gropey boss, teaching Philip Roth to twelve-year-olds, and dancing in public in a see-through yellow mesh vest. Six series later—the first episode of the final one aired last Monday—Hannah is still up to the same tricks. She remains relentlessly entertaining—and Girls is still brilliantly funny television. But she is also sickening, and her behaviour often makes her a difficult character to watch.

The same thing might be said of Girls as a show. With its abundance of grimy nudity, blasé swearing and egotism, Dunham’s sitcom is not always an easy jaunt—even if the laughs make it worth the discomfort. When it first aired in 2012, Girls caused shockwaves for its unapologetic portrayal of twenty-first century femininity and privilege. The four central characters were all largely unlikeable. Criminally for a show about women, they didn’t even seem to like each other much. “It’s not like I’m interested in anything they have to say either,” says Hannah, after her boyfriend Adam complains about her “uninteresting” friends coming for dinner. “That’s basically the point of friendship.”

Stumped for a predecessor, critics initially looked to Sex and The City: another “zeitgeisty” HBO sitcom about women in New York. But the comparison falls wide of the mark. Girls is, if anything, an anti-Sex and The City. Where the SATC aesthetic was notoriously glitzy, inGirls clothes are patchy and piecemeal—set stylist Jenn Rogien has said that she tailored Hannah’s costumes to look “ill-fitted.” Where sex was often glamorous and (at least) hygienic in the 90s show, in Girls it is sweatily dreadful. Moreover, the city itself is depicted as a lacklustre wasteland, full of stunted potential. This is a sitcom for a generation of women who have become disillusioned with the slick image that Sex and the City sold to them. The characters are not bothered about busting cellulite, hoarding expensive shoes, or waiting for an unctuous tycoon to whisk them down the aisle. Instead, their conversations focus on sociopolitical issues: gender fluidity, gentrification, abortion, sexually transmitted diseases, and so on.

If you think that Girls sounds like it might not be your cup of tea, there’s a chance that you’re right. Written by Dunham, who also plays Hannah, the show is targeted at a specific audience, and makes no apologies for it. The brittle tone of Dunham’s dialogue is reflected in her responses to criticism. When shock jock Howard Stern expressed revulsion at seeing Hannah’s un-Hollywood body-type naked onscreen (“a little fat girl who looks like Jonah Hill”), Dunham called into his radio show to confront him. Since then he has completely reversed his attitude (“I’m a superfan now”) and Dunham has continued to parade her characters naked in front of the camera. In the pilot of the new season, Hannah peels off a hired pink wetsuit to reveal she is not wearing anything underneath. Later, she sun-tans her nether regions in an attempt to get “Shailene Woodley’s glow.” It is both refreshing and funny to see a woman so comfortable in her random nakedness on prime-time television.

Whether you love or loathe Dunham’s brash attitude, the Howard Stern saga serves as a caution against dismissing Girls without having properly watched it first. Her spiky defiance undeniably lends the show an energy—and an urgency—which ultimately stretches its viewership beyond the target demographic of young women. As I wrote on Prospect’s website a few months ago, at least as many men watch Girls as women do. Is this because men enjoy watching young women talk about sex? The ugly details and clunky nude scenes make that a hard case to argue. No: a better answer is because Girls is genuinely funny. The dialogue has a dry, neurotic quality previously reserved for male auteurs like Woody Allen and Larry David. The situations in which the characters find themselves are a heady mixture of bone-dry realism and disorientating absurdity. It is also particularly good at weaving in obscure pop-culture references, delivered so speedily and breezily that they don’t come across as smug.

“Oh my god, I’m basically a millennial Gidget,” Hannah says through a mouthful of food, after being commissioned to write an article about surfing, “who by the way was Jewish, which no one wants to talk about.” The editor opposite her doesn’t want to talk about it, either. “Um, no she wasn’t, and that’s not the angle of the piece,” comes the terse reply. There’s more than a hint of Woody Allen in these asides—a sense of being over-educated to the point of being ridiculous.

In the last five years, no show has so joyfully captured the disappointments and frustrations of young twenty-first century life as Girls. Despite its dry tone and bleak subject matter, there is a spontaneity and springiness to the show that leaves you feeling uplifted. The characters, even in their darkest slumps, still find the energy to dance outlandishly and then give things another go. Girls leaves in its wake a trail of new female-led sitcoms, including Broad City and Fleabag, but none of the successors have the audacity or the sharp bite of the original. It will be sorely missed.

Girls airs on Sky Atlantic on Mondays at 10pm