The Seventies have been maligned for all the wrong reasons: glam rock and tank tops, cheesecake and cheesecloth, Beverly from Abigail's Party thinking red wine belonged in the fridge and the BBC thinking Noel Edmonds belonged on the telly. But culturally, the decade was not all it has been cracked down to be. Lapels were too wide and album tracks too lengthy, but the generation that inherited the Sixties ran with the decade's competing spirits of celebration and investigation and then, with punk rock, auto-corrected itself and rejected its excesses of materialism and piety. Cultural history is much more tolerant of the Eighties, which is strange given that the fashions - those shoulder pads and anaemic pastels - have dated just as badly. Was the ploughman's lunch really an improvement on chicken in a basket?

What the spectacular nastiness of the Thatcher decade obscured is the real cause for looking back at the 1970s in horror. Politically, it was horrid, a time of savage class division, racism, terrorism and the beginnings of mass unemployment combined, rather miraculously, with record inflation. We who came of age in those years were special. Our ambition, our humour and, in occasional cases, our idealism survived the power cuts, the filthy trains and Heath and Wilson and, my God, Nixon.

But excuse me, just because I was 16 in 1974 does not mean I was fated to like Jonathan Coe's The Rotters' Club or the BBC's new adaptation of it (Wednesdays, 9pm). Set in 1976 and 1977, this story of a bunch of bright Brummie schoolboys making sense of their times has plenty of potential to annoy as much as delight those of us who were there. That, by recalling the period so perfectly, it does delight should perhaps surprise me less than it does. The adaptors, Dick Clement and Ian La Frenais, wrote one of the most convincing social comedies of the era, Porridge, starring Ronnie Barker. As for Coe, who wrote the excellent original book, he not only produced the best British novel about the 1980s, What a Carve Up!, but in 1976 was a Brummie teenager himself. The director, Tony Smith, is helped by filming in the Isle of Man, a benighted land still firmly stuck in the 1970s, and by a superabundance of archive footage (so much that each episode has a different set of clips for its title sequence). The clothes are not too outlandish and the dialogue is spot on - or almost: I don't recall anyone saying "Waddever" back then.

The story is located in what was known as a direct grant school, a hybrid whose abolition was one of Labour's meanest acts given that these public schools were obliged to fill half their places with bright working-class pupils whose fees were paid by the state. It is an ideal crucible for a class-conscious drama set in a period when both the bourgeoisie and the workers felt they faced extinction.

Not that our schoolkid heroes are concerned with all that, not when there is falling in love and the future of rock music to worry about. Ben Trotter, played in just the right haircut by a star in the making called Geoff Breton, is at the centre of the piece, an introvert who prefers to review than appear in the school play and appreciates Yes's Tales From Topographic Oceans a tad too much. His seriousness is undermined, and he knows it, by his understandable crush on the beautiful but trivial Cicely (Alice Eve). Ben is tightly defined against the more confident Doug - who has the balls to turn up at the offices of the NME - the "prog rock" expert Philip and Sean, a dangerously anarchic school comedian.

We are, thankfully, asked not to laugh at these characters' intellectual, romantic and, in Ben's case, spiritual passions, but to share them. This is made easier by the boys being considerably wittier and more original than their parents. When these hove into view, some of our interest wanes, perhaps because the politics of Longbridge never were that interesting, not even if the factory shop steward was having it off with a factory secretary. The love affairs of the grown-ups are all more tawdry and ridiculous than those of their offspring. In the case of the romance between Philip's working-class mum and his velvet-suited art master, credibility is not, anyway, helped by some rather broad playing from Sarah Lancashire and Julian Rhind-Tutt - although it is just possible that the director has deliberately pushed the older actors towards caricature in order to make the teenagers seem more real.

At the end of episode one, Ben's sister, Lois, loses her fiance in the Birmingham pub bombings. This shocking bereavement renders Lois literally and, it seems, permanently speechless. Ben takes her out for walks from the hospital where she is recuperating but, rather wonderfully (for this is the nature of adolescence), he does not let her tragedy diminish his sense of his own emotional melodrama, using her as an audience for his soliloquies about Cicely.

To fade the Birmingham bombings into the background in this way may sound callous, but it points towards the genius of the piece. Social comedy needs to be rooted in a specific time and place, but also to flower freely within it. Combining the political and the personal is a hard trick. Our Friends in the North, much praised but bruisingly on the nose, muffed it. Coe, Clement and La Frenais do not.

Andrew Billen is a staff writer on the Times