The character of jailbird Norman Stanley Fletcher was originally conceived for a one-off comedy, Prisoner and Escort, forming one of Ronnie Barker's 1973 season of TV pilots, Seven of One.
The BBC picked it up the next year for a full series, but neither they nor writers Dick Clement and Ian Le Frenais can have known quite what a phenomenon they'd created with the show they thought of calling Bird or Stir, before settling on another euphemism for life behind bars, Porridge.
When the new show first aired in 1974 it was greeted with outrage in sections of the tabloid press, shocked at the notion of a comedy programme glorifying prison.
Little time was needed, though, before any complaints were drowned out underneath a chorus of critical acclaim and public adoration for what remains one of the most classic British sitcoms ever produced.
Fletcher himself is an old hand at 'doing time', and we meet him serving a five-year stretch at HMP Prison Slade for breaking and entering - each episode would begin with the booming voice of the judge (recorded by Barker) passing sentence and the stark slamming of prison doors.
Fletcher expects to enjoy a single cell but he's forced to share with a first-time offender, a naïve, young Brummie called Lennie Godber (played by Richard Beckinsale).
Fletcher reluctantly takes Godber under his wing and helps him to 'keep his nose clean' but together they always end up getting into trouble (often for reasons beyond their control), either with other inmates or the prison officers at Slade.
While the richly comic dialogue between the two cell-mates was a joy to watch, Clement and Le Frenais' wonderful writing didn't stop there, and they populated HMP Slade with a host of memorably eccentric characters, from kindly but senile Blanco (played ingeniously by a young David Jason), disgraced dentist Harris and dim-witted Warren to the irascible Scot MacLaren, conman Ives and the prison Mr Big, Harry Grout.
While Fletcher's knowledge and experience saw him regarded highly by most fellow inmates, it didn't stop him being used and blackmailed from time to time by Grout, who'd often force Fletch into tasks against his will.
It was Fletcher's day-to-day job to juggle life on the landings with not getting caught by the wardens, which meant taking advantage of the kind-hearted and soft-natured Mr Barrowclough, and sidestepping the eagle eye of the harsh, suspicious Mr MacKay (portrayed with delicious menace by Fulton McKay).
Episodes would usually involve Fletcher and Godber getting into trouble but somehow scoring a minor victory, usually against MacKay. The glee Barker injected into Fletcher's little triumphs was magical to watch.
Porridge is probably the classic realisation of the sitcom method of putting characters in a situation where they're trapped with each other.
In Fletcher's case it was with his cell-mate Godber, and the wonderful relationship between the pair in the scripts was elevated to pure gold by the sparkling chemistry between he two leads, Barker and Beckinsale.
Writers Clement and Le Frenais were so successful that the show became essential viewing inside Britain's real jails, and prisoners claimed it was the most accurate portrayal of real prison life on TV.
Its massive success spawned a superior spin-off movie and a Bafta-winning sitcom sequel Going Straight, set around Fletcher's life on release from Slade, before more episodes were curtailed by the untimely death of Richard Beckinsale in 1979.
Porridge was a show never afraid to throw into the mix scenes of true drama, as Godber and sometimes even Fletcher occasionally struggled to cope with the grind of being stuck behind bars.
The way in which such moments were woven into episodes, adding depth and realism to the series without ever diminishing the humour, is yet another reason why it remains unarguably one of the all-time classics.
The BBC is not responsible for the content of external websites.