The article and current comments here miss a critical point - this industry is expanding exponentially. People don't often switch careers completely, so of course most new entrants are young. If we look at this again fifty years after the industry size has stabilized, you would see a normal distribution of ages just like in carpentry or car mechanics or any other profession.
> the number of software developers aged 55 to 64 years increased from 87,000 (8.3%) in 2011 to 195,000 (10.7%) in 2019 in the USA.
The number of older software developers MORE THAN DOUBLED in 8 years in absolute numbers, but only increased by 25% in relative terms. That strongly indicates that existing developers weren't pushed out, they just were swamped by new entrants.
There is definitely some drop off around middle age- in 2011 there were 529,000 working "programmers" (computer programmers, software engineers and web developers) in the USA between 35-44. In 2020, there were 400,000. That means about 1 in 4 left the profession (probably more like 1 in 3 to account for new entrants). But that means the vast majority of people programming between 35-44 were still classifying themselves as programmers 10 years later. The drop off from 45-54 to 55-65 was even shallower at 13%.
So the data suggest that despite the mid-age drop off most programmers seem to stay programmers most of their career. I'd expect that many of those exiting "programming" as an occupation are transitioning to management, technical sales, or closely related professions as well, but it wouldn't show up in the data I looked at.
Given that I, being in that 35-44 cohort, am not going to worry to much about how to stay in the profession. I just may ask myself if there is something else I'd like to do as a 2nd act.
Edit- sources: 2011 US CPS- https://www.bls.gov/cps/aa2011/cpsaat11b.htm
2020 US CPS- https://www.bls.gov/cps/cpsaat11b.htm