One of the reasons we see fewer older developers is that software development wasn't a major career in the 80's and even early 90's. Nothing like it is today in terms of numbers of people. So, there just weren't as many people doing it. Now that they are older the number of younger people dwarf them, in part, because the number of jobs has gone up.
Older developers are there. I know a number of them.
There are also company differences. Some companies don't like to hire older developers. Some of these companies want people to work around the clock and older developers tend to have families and hobbies. It's harder to have an influence on them to work a major number of hours.
Then there are older developers who do not want to change. I know some of these. As technology changes a breakneck speeds they don't want to move on from what they did to something new. This can cause issues and give the age group a bad name.
I find the most successful older developers are those who use their experience to do a good job and what needs to be done while adapting as things change.
We have web,app, and even game dev. Personally I work in Data Engineering/Machine Learning/Applied Stats space with some app dev work as well. I'm learning to wear a lot of hats as we segment into small groups and it effectively feels like a bunch of different startups in a "closed" economy of the company.
I'm not good with people, so I doubt I'll ever be in a position to do so, but the ideal team composition to me needs a mixture of naive geniuses and people who've been around the block enough to know when to say KISS.
If you can kind of transcend past manager to "architect" then it seems to be much more "cool" to have older staff. If you're doing something highly cyclical (or prone to fads) like designing websites it would have to be an uphill struggle. Experience is hard to measure and value, in some areas more than others.
Obviously the company matters a lot too, e.g. maybe avoid IBM... I suppose you'd have to spot whether the management are likely to believe that youth guarantees innovation (to quote James Bond of all people).
Also why don’t you move to management? I’m soon to be 35 and I’m taking a director role now primarily because it’s somewhat the natural progression path.
A lot of the experience you gain isn’t purely tech focused and it’s a shame to let that experience go to waste.
Some amount of what you hear about age discrimination is older candidates are less familiar with CS fundamentals because you don't use them all that often on the job, whereas fresh-out-of-school candidates still remember them.
This isn't to say the typical software engineering interview is effective or ineffective, just that preparing for what you know you'll be tested on helps a lot.