I am 50 and I do OK. I also see people around my age and older who do well too. It seems to me that a lot of people who get filtered out in their 30s should never have been in the profession either for lack of motivation, interest or talent. If you are not self motivated to constantly evolve you have a problem. Moreso than in a lot of other professions.
Programmers to programmers: You must be a super agile ninja capable of teaching yourself everything at a moment's notice.
Businesses to programmers: Yeah, we still need people doing Java 6 and VB6. We're also going to disregard all of your security and technical debt concerns. We're also going to hire managers who suddenly change a bunch of tech, causing the rest of the team to re-train themselves, harming their career.
I still don't get where this need comes from. The world still needs LOB developers. The uber-ninjas haven't solved that problem yet. It isn't going to maximize your lifetime earnings, but you're not likely to retire under $100k either.
Programmers are extra-ordinarily hard on themselves and other programmers in industries where businesses still just don't give a fuck because they are making so much.
I really wish I knew why you guys did this to us.