I definitely think ageism is a real problem, and as someone who's happy to hire older developers it's a shock when they talk about their rejection rate compared to what the 20-somethings and 30-somethings face.

But I can also see where the stereotype comes from. The big problem for older developers is developing a misplaced sense of pride in being unwilling to engage with the inevitable changes in technology. After a few rejections it's easy to start rationalising this as, "they don't want someone experienced who'll be expensive and know they're being taken advantage of" or "they know I'll show up all the idiotic decisions that greenhorn CTO is making" - which worsens the problem, because now as well as the age and skills disadvantage they're coming across as arrogant in interviews. It's hard to talk people out of this spiral because they think the attitude is a good thing, and they're getting that reinforced by all the people in a similar boat saying similar things.

(This is probably too much an aside, but IME older folks are some of the most naive about the salaries they should be asking for and how the company should treat them! For a company, the big benefit of hiring people who're 50+ is the tendency to be too good at the, "I'm just going to do what you ask me to do for whatever I'm paid without challenging anything" aspect. Recent graduates these days don't put up with the nonsense their forebears did.)

One of my favourite teams to work with had two 50+ guys in it. One who had the most incredible enthusiasm for new technology, and of course with 30 odd years of picking up a new tech every few months was incredible at it. You'd see him study something over a weekend and come back going, "so this is really a functional language at core, and I've worked out the idiomatic way to build an API in it is using this". The other built a lot of the testing code and did a fantastic job of playing the age-worn cynic in a way that made the younger team members laugh while embedding the point about defensive coding and building for testability. But there have also been plenty of older devs more of the, "J2SE was fine for me and it should be fine for you; all those new language features only make your code unreadable, you'll understand once you've been doing this job as long as I have" school which drives the stereotype.

The sad thing is I reckon you can tell which way a developer is going to go as early as 5-7 years into their career, because by that point things will have moved on from what they first learnt and you can see whether they're engaging with it or refusing to change.

Of course, for the author of the article there's the additional problem that any typical HR department will be drawing a big red flag in the "years until retirement" column, and in a lot of companies they will have veto power too early on in the process for a hiring manager to interview and find out what the actual story is. As others have mentioned it's difficult to overcome this, but you need to take charge and start looking for jobs on platforms where you'll be talking directly with team leads and engineering managers rather than going through the classic agency > HR > interview process route, which is basically designed for risk elimination through standardisation.

tl;dr: if you find yourself getting old in spite of your youthful belief that would never happen, stay enthusiastic and don't get bitter. I guess that covers more of life than just software development.