Age is an issue with software devlopment. Early forties is not old at all, realistically you will likely be working for another 20 years unless you've already made significant money. In many professions such as law you're only getting started at 40. If in software it's an achievement to reach that milestone than something is wrong.
As one of the few left of my peers that still develops I would say that it is a milestone. There is a lot of burn out and churn along the way. I knew guys that left software dev to become a worm farmer. Most take the elevator up to management which is what I did becoming a CTO but I always position myself at small but growing companies so I could keep myself hands on with technology. I have two friends left that started dev around the same time as me (92). For most it's just not a long term industry and burnout usually takes it's toll.
That being said the web revolution happened in the early 90's and was a huge shift in development. There where a lot of older devs around at that time who where doing desktop and had no desire to make the jump so 40'ish is also kind of a demarcation line of where an epoch changed in development, so the fact that you see few over 40 devs could be a) that the web was small back then and there where only a handful of us doing it and b) The developers that where doing web in the early 90's where all young, therefore it is kind of origin of a new type of developer.
If you're talking about the internet, a decade is a long time and an important distinction. We're not talking about a 32 year old dev. I mean hell I know plenty of early 30s folks.
40 years ago was 1976. We're talking about people who were born not too long after we landed on the moon (or even before). There's just not a lot of people that age who both went into programming and are still doing it, as opposed to management or something non-technical entirely.
So while it's not at all surprising to see an early- or mid-30s developer (I work with many), it is very surprising to see a mid-40s developer (I've only ever worked with two, and one had an almost violent aversion to anything except procedural VB).
Programming is a skilled labor, not a profession, in that you are "supposed" to do it for a couple years and then move on. Like teens used to work at McDonalds and give weird looks to the creepy 30 yr old guy still working fast food.
When its not noteworthy for programmers to have an age distribution similar to the greater population, or for experience to be respected instead of being made fun of, then programming will finally become a profession rather than a semi-skilled labor.
Personally I don't mind being made fun of by the kids... I get a lot of money cleaning up their inexperienced mistakes.
Please. That's borderline insulting to people who have to earn a living through actual, physical, labor.
Every programming job I've taken has started with the "Do you see your future self as a senior developer or a manager?" discussion. It's absolutely a viable career path to stay a developer, or at least it is now.
And there's the tired "lol these 30 year old kids don't know what they're doing I'm getting rich fixing their mistakes!!" tripe.