Some of the wittiest people I know are politicians. I know that sounds foolish. The problem for the MP-as-funster is that, like radio stations with live phone-ins, they have to have a tape loop in their heads, warning them in advance of anything rude, obscene, or even controversial. The loop usually censors the joke before it comes out. But many politicians are exceedingly funny in private. The most unlikely wag? Ted Heath. Surprisingly, he could be very funny indeed, though his humour was so dry you could have used it in a Martini.

I remember a pub crawl in Bexley on eve-of-poll in the second 1974 election when he already knew he had lost. His tales about politicians he had known were terrific - not least about Harold Macmillan whom he had been to see in hospital just after he had resigned the Tory leadership. "I have just died, dear boy," he said.

"Don't be silly," Ted replied. "Oh yes, I have. Two men came in. I woke up. ‘What do you want?' I said. ‘We have come to take away your scrambler,' they said. And that was how I knew I was dead."

All told flat and deadpan, like when he was asked if, on hearing the news of Mrs Thatcher's resignation, he had said, "rejoice, rejoice!" "No," he insisted with fake anger. "I said, ‘rejoice, rejoice, rejoice!' Three times."

It didn't always work. John Nott, later defence secretary during the Falklands, then number two at the Treasury, went up to him in the lobby during a vote. He wanted a word about growing inflation, and asked for a meeting. "If you want to resign, put it in writing," said Heath as he stalked off. Nott was deeply offended; Heath's friends insist it was a joke.

Margaret Thatcher - now there is an exception to the rule. She didn't do humour. When Peter Jay said that his father-in-law Jim Callaghan saw himself as Moses leading his people out of the wilderness, her speechwriters came up with the line: "I have a message for Moses - keep taking the tablets." She didn't get it, and wanted to change it to "keep taking the pills".

Churchill was without doubt the politician of the past 100 years most famous for his bon mots, and there's no space to repeat them all here. Though, just as anything funny said in the 19th century tends to be attributed to Oscar Wilde, so many political gags are awarded to Churchill. He did write that Clement Attlee was "a modest man, with much to be modest about", though he never said that "an empty taxi pulled up at Number Ten...and Attlee got out". In fact, he was furious that the remark was pinned on him, since he was deeply grateful to the Labour leader for his help as the wartime Deputy Prime Minister. Many lines are undoubtedly apocryphal - for instance, Churchill: "Why is that man talking so loud?" Churchill's friend: "He's talking to Edinburgh." Churchill: "Why doesn't he use the telephone?"

The wittiest modern-day party leader must be Neil Kinnock. It was he who invented lines such as the one about Peter Mandelson mistaking the mushy peas for guacamole. These misattributions were so deft that they stuck; people genuinely believed that the victims must have spoken them. Like that burr in Kinnock's hide, Eric Heffer, who was skewered by the mock quote: "My father was a carpenter, too."

Neil used to MC the annual Labour Party conference revue in the mid-1970s, and if he did not err on the side of brevity, he provided some very funny moments. I helped write a sketch he performed as a schoolmaster with mortar board and cane, demonstrating with mathematics that if we had £1 for every minute that had passed since the birth of Christ, we would still have only half the amount by which the Treasury had underestimated the public sector borrowing requirement that year. Better make that every second, these days. Or Kinnock telling an Australian joke I can't repeat here, but which some of you may know - it ends: "Flying doctor says you're gonna die, Blue..."

One problem for MPs is that jokes in the Chamber rarely work outside. They're also tricky to report, since you have to spend so long setting up the gag that by the time the reader reaches the punchline they have lost the will to live, or at least to read. But two stand out. Shortly after Harold Wilson had resigned - and when Joe Haines revealed that Marcia Falkender had drawn up his resignation honours list for him on a piece of lavender-coloured notepaper - Dennis Skinner said: "When he resigns will my Rt. hon. friend take a piece of notepaper - not lavender coloured - and write on it the following...'

Unknown Tory: "Skinner!" Collapse of entire House. Perhaps you had to be there.

The most effective heckle I can recall came in December 1997, during the first debate on hunting with dogs. Michael Heseltine was just getting into his stride in what was clearly meant to be a majestic speech, laying down the law forever on this tricky topic. He discussed alternatives to fox-hunting. "And what do we mean by ‘flushing out'?" he asked, grandly.

Denis MacShane: "Ask Mrs Thatcher!"

There was a tidal wave of laughter and the speech did not recover.

I guess the funniest front bencher in the House these days is William Hague. How he has blossomed since quitting the leadership! No wonder he can charge such immense fees for public speaking. No doubt some of his jokes are written for him, but they are for most comedians; the art is in the delivery. Most MPs can remember his gag when Frank Dobson was the official Labour candidate for London mayor and Ken Livingstone was running as an independent. Tony Blair could have both, Hague said - Dobson would be the day mayor, and Livingstone his night mayor.

Michael Foot could also turn a phrase: "Norman Tebbit will long be remembered as ‘the semi-housetrained polecat.'" He drew much of the inspiration for his personal invective from his hero, Aneurin Bevan, the man who referred (not by name) to Hugh Gaitskell as a "desiccated calculating machine", though what use a damp calculating machine would be, I don't know. Foot helped to see off the idea of an appointed House of Lords with his devastating line in 1969: "think of it, as a second chamber selected by the whips! A seraglio of eunuchs."

Denis Healey did effective invective too: Margaret Thatcher was the "Passionara of Privilege" and being attacked by Geoffrey Howe was "like being savaged by a dead sheep" - though I always thought that was over-the-top; it would have been crisper and funnier without the word ‘dead'. Sir Geoffrey did not joke himself- the New Statesman once ran a competition for opening lines from your hostess that would make you regret coming to the party; the winner was: "Do come in! Sir Geoffrey is on sparkling form tonight!" When in 1990, the sheep finally bared its fangs, the victim was Margaret Thatcher, who was well and truly savaged.

Some MPs have been professional humorists before going into politics. AP Herbert was famous for his legal satires, Misleading Cases, long before he became MP for Oxford University, from 1935 to 1950, when the seat was abolished. Clement Freud became an MP because he wanted to be remembered for something other than being that bloke who appeared on the telly. He sat as a Liberal for the Isle of Ely, now NE Cambridgeshire, from 1973 to 1987. His problem was that people expected him to be funny even when he wanted to be serious (though some of his jokes at the time of the Thorpe leadership crisis are probably unrepeatable, even today). In his election meetings he had a routine when he wanted to finish: he would take out an old-fashioned watch and study it gravely. "This watch belonged to my grandfather [Sigmund]," he would say. "He sold it to me on his deathbed."

Gerald Kaufman was one of the most prolific writers for the old That Was The Week That Was show probably the programme that did most to sweep away the old deferential culture on TV. MPs had never been subjected to that kind of mockery or scrutiny, at least since the early 19th century, and they were shocked. Few would have imagined that one of their leading tormentors would go on to become Harold Wilson's press secretary in Downing Street, and then an MP himself. It was Kaufman who memorably called Labour's 1983 election manifesto "the longest suicide note in history".

Most politician novelists - Douglas Hurd, Maurice Edelman, Chris Mullin, Edwina Currie, for example - have tended to favour thrillers, though the late Julian Critchley did write two comedy sort-of crime stories, which were a witty, dry, sometimes hilariousblend of fact and fiction, in which real people mixed with Critchley's inventions. He also wrote a consistently witty column for the Listener in which he used fantasy and opprobrium to skewer his b?tes noires, such as Sir Alfred Sherman and indeed Margaret Thatcher, whose administration he once (anonymously) compared to the Charge of the Light Brigade, "except that Florence Nightingale is leading the charge, and Lord Raglan is tending the sick and wounded".

The whips knew it was him - he'd been peddling the joke around the House for some time - and that put paid to any hopes of ministerial office. By the time John Major (again, no barrel of laughs) took over, Critchley was too ill to serve anyway. He crossed her another time when he made the common mistake of imagining that if you say something on local TV nobody will hear about it. On a regional show he called Thatcher "the great She-elephant". Asked to explain himself, he said gravely: "I am told it is a term of great respect in Botswana." He also accused her of never seeing any institution "without wanting to hit it with her handbag". It was Critchley who remarked that "the only safe pleasure for a politician is a bag of boiled sweets", which also gave him the title of his memoirs.

The two backbench MPs who make me laugh most these days are Steve Pound and Bob Marshall- Andrews. Pound's great skill is the lengthy riff, almost like Dave Allen. Two years ago he devoted a whole Commons speech on the smoking ban to a hilarious account of his years as a teenage smoker. A group of us sat, bent up and in helpless pain as we listened in a Westminster pub to Pound's description of his days as a boy sailor in the Royal Navy. Part of the tale, which lasts around half-an-hour, involves the lad who was chosen to climb out of the dockyard in New York and visit a brothel. The medical results of this adventure were calamitous, and by the time the ship reached the Caribbean, he was confined to the sick bay. The captain took the cadets to see him as an awful warning. He flicked over the bedclothes and declared: "That boy has been putting his [rude word for the male member] in places where I would not place my umbrella ferrule!"

Marshall-Andrews, meanwhile, loves to coin gags at the expense of his own side. I sometimes wonder if he actually realises that Tories exist. He certainly doesn't bother to tear into them. In 1997, at the Labour conference, Tony Blair had an approval rating in the polls of 93 per cent. But Marshall-Andrews was not disheartened. "Seven per cent," he said, "we can build on that!"

He was disillusioned with Gordon Brown in equally short order. "He has the judgement of King Lear, the decisiveness of Hamlet, the paranoia of Othello, and the loyalty of Brutus. But thank God we've got rid of Lady Macbeth!"

Simon Hoggart is sketch writer for The Guardian