IT’S often said that laughter is the best medicine, although I feel we should also give penicillin its due.

Research suggests humour is a great reliever of stress and that those who smile a lot tend to enjoy better health.

So amid all the gloom uncertainty of 2017, it’s particularly sad to be losing people like Alan Simpson, who died this week at the age of 87.

He wasn’t just one of our great comedy writers, but one of our greatest writers of any kind. I met him a couple of times and he was as charming and funny in person as you would hope.

Together with Ray Galton, he wrote an incredible 166 episodes of Hancock’s Half Hour for radio and television, before producing 58 episodes of Steptoe and Son.

These were huge shows, which caused the pubs to be empty and the streets quiet. In 1964, Labour leader Harold Wilson lobbied the BBC to delay the broadcast of Steptoe on general election day, lest it keep people away from the polling stations. Wilson reportedly believed that the decision to delay broadcast until 9pm may have gained him 20 seats.

I can’t think of Galton and Simpson without recalling half a dozen beautifully crafted lines.

There’s Hancock looking forward excitedly looking forward to a night at the pictures consisting of “two Xs and a Tweetie Pie”, or saying of an intimidating intellectual: “He thinks Bertrand Russell’s a bit of a Charlie.” Or Harold Steptoe deriding his dad’s Tory politics: “You haven’t got two ha’pennies to rub together and you’re all ‘Hands off the Stock Exchange!’”

They hadn’t been to university, but Galton and Simpson – who were voracious readers since the days when they met in a TB sanatorium – put more cleverness into the scripts than many an Oxbridge graduate.

On seeing his dad’s tatty Christmas decorations, Harold Steptoe says sarcastically: “I recall the splendour of Versailles during the reign of the Sun King!” (To which old man Steptoe pithily replies: “Are you taking the Arthur Bliss?”)

Humour can be a pretty effective remedy for anxiety about the world’s ills, so I imagine many Steptoe and Hancock discs have been played repeatedly in recent times.

In anxious times, the laughter-makers become some of the most necessary people in society.

On radio’s Today programme recently, one bookseller recommended reading a lot of PG Wodehouse when the news gets gloomy – which is exactly what I was doing during the US elections last year.

As the commentators mused on how a reality TV star who boasted of sexually assaulting women could possibly end up in the White House, it was a relief to retreat to the world of Bertie Wooster and Jeeves. In the universe created by Wodehouse’s spot-on comic prose, the worst thing that can happen to a fellow is that his Aunt Agatha could seek to marry him off, or his pal Tuppy Glossop could get him into a fiendishly difficult scrape.

But if comedy can provide relief from life’s most serious issues, it can also illuminate them.

Woody Allen spent the first half of his career joking brilliantly about his anxieties over life and death. Subjects that are very difficult to discuss seriously can be approached via comedy instead.

And the craziest comedy can sometimes seem the most appropriate response to a crazy world.

Remember 2003, when the US and Britain seemed determined to go to war in Iraq, despite some last-minute hope of inspectors being able to look properly for weapons of mass destruction?

I couldn’t help remembering Duck Soup, the Marx Brothers’ most brilliant comedy from 70 years previously. Groucho is president Rufus T Firefly, who is taking his country to war.

When the other country attempts to sue for peace, Groucho replies: “It’s too late. I’ve already paid a month’s rent on the battlefield.” By the 21st century, the world seemed to have gone Groucho Marxist.