^ This is one person's opinion that reflects their own experience.
I am a 35 year old who has done development, and may do it again in the future. I have kept my skillset updated by taking several AI courses during a sabbatical.
If you are competing against a group that competes for roles that select for what you think is silly, you'll never win. This does not describe most startups; it may be an indicator of bad startups.
There is age discrimination, for sure. In the startup cohort study of the future, I am quite confident those exhibiting this discrimination will not be on the successful side.
Younger devs focus on their skills. Older devs focus on the value they bring to the company. Companies that focus on the latter will do better.
YMMV, we live in a probabilistic world.