Image copyright Mark Johnson

The flatmate comedy Peep Show is ending as its lead actors approach middle age. Why are fortysomethings in shared accommodation still seen as unusual when their numbers are rising so dramatically?

The rows over washing up. The raised eyebrows if you bring someone home. The Post-It notes that scream: "JOSHUA'S MILK, HANDS OFF!!"

Once sharing houses with people who aren't your partner or your offspring was a phase that most expected to be mercifully brief. Who in their right minds would endure cleaning rotas and awkward chats in the shower queue with your flatmate's latest partner any longer than necessary?

"Two middle-aged men sharing a flat like that, that's too sad," said 41-year-old David Mitchell ahead of the final series of Channel 4's Peep Show, in which Mitchell stars alongside Robert Webb, 43, as his lodger. "It's got to stop, because we've got older."

He may not be alone in considering their characters, Mark and Jeremy, a bit pathetic, but - thanks to rising house prices and social change - their living arrangements are increasingly common.

Image copyright PA

The number of people aged 35 to 44 sharing flats rose by 186% between 2009 and 2014, according to the flat-sharing website Spareroom, while there was a 300% increase in the 45 to 54 bracket over the same period. Almost a quarter of house sharers using the site are over 35 while 9% are over 45.

All this helps explain why Peep Show's setting felt so timely and why the series resonated so widely. It wasn't just its discursions on toast ("brown for first course, white for pudding") and DIY (plumbing is just "water Lego") - its claustrophobic depiction of domestic life has become increasingly familiar.

Image caption Lisa Buckland

But public attitudes towards fortysomething renters have failed to move with the times, says 44-year-old Lisa Buckland, who looked online for a flatmate to share the cottage she rents near Marlow, Bucks.

"I didn't get as a big a response when I advertised my real age," says Lisa. "When I dropped my age to 'below 40' I got far more replies."

Lisa, who works as a buyer in Maidenhead, says she's "young at heart" and has got on well with younger flatmates during the six years she has rented in the UK since moving from Australia. But she has noticed a widespread assumption among younger tenants that anyone over 39 who wants to rent must be a bit odd.

Of course, it's not a question of preference. Ideally Lisa would buy her own property, or, failing that, rent somewhere by herself - but like millions of others, she's found neither are feasible on a single salary.

The average rental value in London stood at £1,560 per month in October 2015 - a rise of 7.5% over the previous year - and £749 outside the capital.

If this didn't make saving for a deposit difficult enough, the average home in England and Wales was worth 8.8 times a standard local salary in August this year, according to the Office for National Statistics, putting ownership further and further out of reach.

Image copyright Thinkstock

There's nothing intrinsically wrong with flat-sharing at whatever age, says Dan Wilson Craw of Generation Rent, which campaigns on behalf of tenants. People are increasingly choosing to live in less traditional households, he says, but the housing market has failed to keep up.

"It shouldn't be a stigma. The reason there is a stigma is because it's not someone's choice. People are having to compromise their autonomy."

Even if you have managed to save enough for a deposit, mortgage lenders often penalise borrowers in their 40s who want to take out a typical 25-year loan, he adds.

But if renters like Jeremy feel increasingly hard done by, live-in landlords like Mark were given a bonus in the most recent budget. From April they will be able to charge up to £7,500 each year tax-free in rent, up from the current £4,250 - a move that could incentivise Peep Show-style set-ups.

Image copyright ALAMY Image caption Jack Lemmon and Walter Matthau lived together in The Odd Couple

But it's not always simply a question of financial choices. Literary critic Nicholas Lezard, author of Bitter Experience Has Taught Me, found himself living in a shared flat with a friend nicknamed "Razors" when his marriage collapsed in his mid-40s.

The stigma of midlife flat-sharing didn't bother him. "We were both the kind of people who don't give a damn what other people think," says Lezard. But when Razors moved on, sharing a flat with people 20 years his junior proved a big adjustment: "It's different when you are living with people who are from a different generation.

"There's a bit of guilt: 'I'm 52 years old, I shouldn't be living like this.' They think you are some kind of fossil or they look up to you." There was also the difficulty of accommodating his three children when they came to visit - living somewhere he could afford spare rooms "either on the extreme periphery or in the middle of nowhere" wasn't an option.

And it was this sense of widespread claustrophobia that helped Peep Show thrive. While British sitcoms have often focus on characters stuck together in a domestic setting, they tend to be family members - in Steptoe and Son or Only Fools and Horses, for instance. While across the Atlantic, although Friends had an apartment-sharing set-up, all of the cast, with the exception of Lisa Kudrow, were still in their 30s when the show's final episode was broadcast.

For a portrayal of middle-aged men without any blood ties living together, you have to go back to The Odd Couple or certain episodes of Hancock's Half Hour - discounting, of course, the sketches in which Morecambe and Wise shared a bed.

Communal living, after all, imposes codes of behaviour that are ripe for comic exploitation. "You need to be able to compromise," says Lisa. "I'm a fairly easy-going person. You have to be aware that everybody has their own little quirks." Mark and Jeremy included.

The Magazine on housing

Image copyright Thinkstock

The lowest rung of the housing ladder? (October 2015)

Five ways to survive sharing a bedroom with strangers (January 2015)

A life lived in tiny flats (April 2013)

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.

Are you a forty something flat-sharer? Are you, or have you ever, lived in shared accommodation? Share your stories and pictures with us.

Please email haveyoursay@bbc.co.uk with your experiences.

Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways: