David Nobbs has died. He was a novelist, scriptwriter, creator of sketches for the Two Ronnies, Frost Report and much more. But the achievement that I love that man for - and which, to my mind, confirms him as something of a genius of comedy - is The Fall and Rise of Reginald Perrin. It's just one of the funniest and most melancholy shows that British television has ever produced and the books on which it was based are heart-stoppingly funny and sad.

If you don't know, it's a trio of books and tv series about a suburban, middle-class, middle-aged man working for a puddings company, with the grimly utopian name of Sunshine Desserts, who goes through a midlife crisis. Appalled by the routines of his life, his marriage, his family and his work, he fakes his own suicide; he returns in disguise, remarries his own wife, Elizabeth, and then, in a desperate act of nihilistic resistance to the corporate world, he sets up a shop called Grot, where everything on sale is completely useless. Grot becomes enormously successful and he determines to fake-end it all again; returning for a second time, he decides to set up an alternative community, based on love and trust and openness to make stressed, bored people happier and better. This also does not end well.

I saw some of the episodes when they were originally on TV and loved them. But I read the books, because my mum had them. They were endlessly sad, beautifully moving (oh my word, the last scene of the first book. Seek it out, read it. It's beautiful and the last line will kill you). David Nobbs wrote beautifully; the scenes that most stay with me are the saddest ones; Reggie taking the decision to commence an affair (which is not consummated) with his secretary Joan: Nobbs writes beautifully about his hesitation, his anticipatory regret, his sense that nothing will be the same again. And the last sequence of the third book, where a group of vandals break into the commune and destroy everything, despite Reggie and his friends trying to resist; I remember reading it, probably aged 10, my cheeks hot with anger at the injustice.

And, of course, they are funny. Joyfully funny. Hobbs created a magnificent cast of characters who were both grotesques (with their famous, wonderful catchphrases 'I didn't get where I am today...', 'Great'/'Super!', 'Haven't the foggiest', 'Twenty-two minutes late, badger ate a junction box at New Malden', 'Of course, Cuddlypuddles') but also recognisable, vulnerable, sweet, damaged and wonderful people. And Reggie himself is the most wonderful creation: there's a brilliant scene where his son-in-law, Tom, has brought round some of his famously dreadful home-made wine and Elizabeth has made him promise not criticise it, at pain of having to put money in a jar. But he cannot stop himself. 'This is actually quite drinkable,' says Tom modestly. 'Oh I wouldn't go that far,' says Reggie. I've tried to engineer situations to use that joke for thirty years. 

As in all great comedy, the comedy has an undertow of despair, but the despair is also leavened by moments of peerless joy. The horrifying climax of the third season's experiment in alternative communal living is requited by a scene in which Reggie has gone back to work for Sunshine Desserts. He has taken part in a blind tasting of new desserts and now CJ, his boss, has called him in to discuss results. For every dessert the tasters have been asked to identify the taste; amid the usual guesses at raspberry, lychee, and the rest, there is one discrepant answer that keeps being offered: 'Bolivian unicyclist's jockstrap'. How can this be explained? CJ asks Reggie meaningfully ('I didn't get where I am today by everything smelling of a Bolivian unicyclist's jockstrap!' he barks). 'Computer error?' suggests Reggie, clearly the culprit. 'It doesn't have a computer ring about it,' replies a sceptical CJ. It's a beautiful scene because it affirms Reggie's undiminished spirit of resistance, however childish, however futile.

And throughout, the jokes are somehow just beautifully about despair. Look at this wonderful exchange with Sunshine Desserts' hopeless Dr Morrissey, to whom Reggie has gone for a consultation:

Doc Morrissey: Do you find you can't finish the crossword like you used to, nasty taste in the mouth in the mornings, can't stop thinking about sex, can't start doing anything about sex, wake up with a sweat in the mornings, keep falling asleep during Play For Today?
Reggie: That's extraordinary, Doc! That's exactly how I've been feeling.
Doc Morrissey: So have I. I wonder what it is?

There's a remarkable scene in which Reggie, in a terrible Italian restaurant, eats three bowls of ravioli in a row in an act of impotent surrealist resistance. (I always remember the description of the women at the next table: 'They had the look of people who, having spent too much, now saw no barrier to spending much too much'. How brilliant an observation that is.) Looking back at them now, they seem so clearly a product of their time: the books taking on corporate culture, and then exploring a, successively, punkish spirit of anti-corporatism (s2) and then a kind of new age therapeutic redemption (s3). His brother-in-law Jimmy is a product of the divided 70s which imagined open civil war between the forces of the far right and far left. The books are just beautifully sad. Read them and weep.

Looking back I don't know what nine-year-old me made of the show's critique of 1970s corporate culture, but I think the image of his frustrated acts of lunacy were familiar to me from what I'd seen of the drab 1970s - and that image of his daily commute, umbrella, three-piece pinstripe suit and briefcase, always seemed to me a Ministry of Silly Walks waiting to happen. Maybe I was primed to find that absurd. But also, as a kid, heading towards big school, having that vague foreboding sense that I was imminently to put away childish things, Reginald Perrin was like a child, dressed up in a suit, pretending to be grown up, badly. On the back of the paperback I read, there was a quote from Ronnie Barker. He said 'I still feel I am Reggie Perrin as I walk around'. I knew what he meant. Reggie was in me.

If you haven't seen the show, please get hold of it now. Leonard Rossiter gives one of the greatest performances I've ever seen. Rossiter had splinter-sharp comic timing (watch the 'Pillock Talk' scene (series 2, ep 7) for a great example of his quicksilver oscillation between mocking seriousness and anarchic disrespect; it's deliriously brilliant - and when he starts to notice his interviewer's name, it just becomes stratospherically funny. Oh fuck it, I'll give you the clip below. 

But now he's gone because David Nobbs has died. (It would be wonderful, though, would it not, if David Nobbs had faked his own death and will come back in a new guise. Look out for a brilliant new comedy writer called Martin Welbourne.)

David Nobbs RIP. 
Reginald Iolanthe Perrin RIP.