Friday 13 September 2013 14.59 EDT
First published on Friday 13 September 2013 14.59 EDT

How do you know you've turned 40? According to the veteran comedian Jackie Mason, it's when you bend down to tie your shoelaces and think, "What else can I do while I'm down here?"

When I first heard that gag, I only half got it. Now that I'm deep into my forties, and bending down is no longer, shall we say, effortless, I really get it. But what are the other tell-tale signs of getting older? There's the greying at the temples, not knowing what song is No 1, and, politically, the steady drift rightward. That last one is not controversial, is it? After all, to quote the aphorism regularly, andwrongly, attributed to Churchill, "If a man is not a socialist by the time he is 20, he has no heart. If he is not a conservative by the time he is 40, he has no brain."

Evidence of this hoary wisdom appeared to come with this week's publication of the British Social Attitudes survey. The standout finding was that Britain had changed its collective mind on homosexuality since the first such study in 1983. Back then, 50% regarded same-sex relationships as "always wrong". Now that figure is down to 22%. The hold-outs were the old. Among those born in the 1940s, 46% still thought homosexuality was wrong; only 18% of those born in the 80s said the same.

Indeed, when pressed to explain the overall shift, researchers explained that it wasn't so much that individual Britons were softening their previous hostility to gay people. Rather, those older people who had been implacably hostile were, to put it baldly, dying out – replaced by youngsters who were more tolerant.

It's the same picture on, say, women working outside the home – broadly accepted by most, still difficult for many over-65s. But it also fits with the archetypal image we have of the old – regularly reinforced by popular culture – as grumpy, stubborn and a little bit bigoted. This, we presume, is just how it is – an organic part of the ageing process, as inevitable as wrinkles.

But it's not quite like that. Talk to those who study these patterns and they'll explain that it's not the fact that people are in their late 60s or 70s that gives them these attitudes, but rather the specific period in which they were raised. On gay rights, many of today's senior citizens were shaped in a climate that saw homosexuals as deviants and criminals: for many, those views have simply stuck. It's not as if they were once tolerant and have hardened their hearts as they've grown older. Equally, there's no reason to believe that today's twentysomethings will become anti-gay as they age. On the contrary, the data suggests the attitudes forged now will be theirs for life.

Viewed like this, what matters is not someone's age so much as what Rick Nye, director of the Populus polling company, calls the "consciousness-defining events that happen when you're at your most porous". For the oldest Britons, that was the war. As that generation dies out, so too do many of its values. (To take one example: pollsters have noticed a steady disappearance of the old Edward Heath brand of pro-Europeanism, formed among those who had witnessed a European war close-up and did not want to see another one.) For the baby boomers, the formative experience was the 1960s, leaving a legacy of permissiveness that endures to this day. They may now be knocking 70, but they still have liberal attitudes. In an intriguing aside, Glasgow University's professor Patrick O'Donnell says that, though many boomers have given up on the drink and drugs, they have not abandoned the sexual mores of their youth: clinics now report a rise in sexually transmitted diseases among the over-70s. "That had never been a problem before," he says.

This pattern – of generations shaped by epochal events – shows itself often. Who has misgivings about nuclear power? Not the old or the young, but those in between who came of age at the height of the "No Thanks" campaigns. Who remains sceptical about collectivist, non-market ways of organising society? Those whose worldview was formed as the Berlin Wall came down and who saw trade unions crushed at home. The Iraq war has, it seems, convinced a generation to recoil from armed intervention abroad, especially in the Middle East. The evidence suggests such beliefs remain all but fixed for that generation – and influence the generations that follow.

By this logic, it would be perfectly possible for the old to stand to the left of the young. Indeed, the Social Attitudes survey found more sympathy among the over-65s for government redistribution of income than among any other group. But it's not the whole story. There are some political changes that do indeed come upon us as we grow older, no matter when we were born. Just as new parents suddenly find themselves interested in the previously tedious topics of childcare and education, so older voters start thinking about, say, pensions. That, though, can cut both left and right, as seniors demand both state payouts and a strong stock market to buoy their private retirement plans.

More deeply, those who have been around longer find they have more to protect. And that can become a conservative impulse. Peter Kellner, president of YouGov, believes it is "attitudes to risk and fears of uncertainty" that change most: people become more cautious as they get older. That's one reason why reform of public services used heavily by the elderly becomes so politically radioactive. But it also sheds light on, for example, the striking age profile of Ukip, which skews towards the old. Plenty of Britons are unsettled by our changing society, whether by immigration or new technology, but, says Kellner, "There's a fear of the modern world which is more intense among older people."

That fear doesn't grip everyone with years on the clock. Those who have money and options, who feel life is still ahead of them and their race not yet run, can handle change; they can afford it. Those who are on a fixed income, watching their savings dwindle, for whom life has become no more than managing decline – who would blame them for becoming defensive, holding on to what they have and what they know? Viewed like this, it's wealth, not age, that's decisive.

Either way, conservatism is not like grey hair – an inevitable part of the ageing process. It depends on when you came of age, how you saw the world and how life treated you. That's worth remembering. For it means the decisions we take now, shaping the young who witness them, will live on long into the future – long after we've gone.