While I’ve no doubt that age discrimination does exist, when you see people who are former programmers at 40 (or 30 for that matter) it’s often just that they started out in programming but got bored of it and moved on to other careers. Or gradually became managers rather than programmers.
Statistics may certainly show that programmers skew young, but its not always due to being forced out, or denied opportunities, because of age.
I don't think those are cleanly separable. When you talk with people who left the industry, it's very rarely, "I was successful and engaged and really enjoying it, so I decided to switch to something entirely different where I had to start over and earn a lot less."
For a lot of people who experience discrimination, it's not one big blow-up that forces them out. It's the steady drip-drip-drip of being treated poorly, denied opportunities, etc. Eventually they just get worn down.
And sometimes when people aren't that good at their jobs, they blame external causes instead of accepting responsibility for their own performance. (Note: I do realize that discrimination and bad managers are real things, but then again so is the Dunning–Kruger effect.)
This is true, but at best it's irrelevant to the point being discussed. And at worst it's the sort of victim-blaming that is used to undermine every time discrimination comes up.
I'll second that. I'd also add that most programmers have high fluid intelligence. This makes it rather easy for them to retool into another field and end up being talented at it.
Industrial psychology has very consistently found that fluid intelligence is a stronger predictor of job performance than even experience. It's often the case that the software engineer who becomes a manager at 45, ends up being better at it than the MBA who's been doing it for two decades.
> Over time, the validity of job experience for predicting performance declines, while that of ability remains constant or increases. Path analyses indicate that the major reason ability predicts performance so well is that higher ability individuals learn relevant job knowledge more quickly and learn more of it.
Statistics may certainly show that programmers skew young, but its not always due to being forced out, or denied opportunities, because of age.