"Ageism is real and some of the younglings treat me as someone whose knowledge is obsolete, only to be proven wrong."
This meme is slowly dying, but let me do my part here to kick it along to death faster.
Nothing here is intended to offend per se, because I consider everything I say here to be the natural order of things, and there's nothing wrong with it. Still, it's the truth.
I'm in my mid-40s now. I've hired a lot of juniors over the years. Never once have I hired someone new and gone "Oh my god, they know so much, my job is at risk and I'm going obsolete!"
No, what happen when I hire junior is that I look at where they are now, and where they need to be to be a fully functional member of the team, and kind of sigh and make a plan to try to get them there as quickly as possible, plotting a minimal path through the thicket of things necessary to be a functioning software engineer nowadays. Six months is generally a bare minimum time line for this. Sometimes it's more.
And that's just to get to functional. A well-rounded engineer that I can plausibly just pass a project to and see them largely get it done correctly and without blowing their own or my foot off? Years. Years. And I just mean that from a technical perspective... it's yet more before I feel comfortable inserting them into the political layers.
Again, not intended to be offensive. Everyone has to pass through this phase. Every mature programmer should expect to be mentoring like this; if you're in your 40s and haven't had to do this at all, take a careful look at your career, something's probably wrong. (I don't mean management; I mean mentorship.)
There was one intern a few years ago who turned my head in that he had parity with me on a couple of interesting and unusual skills, but still... it was parity at best, not amazingly better than me. And while he had some amazing building skills for an intern I could see the skillset was still very, very lopsided and he needed a lot of work on the question of what to do, rather than just the doing of things. It's OK. That's normal. I'm not even sure how to hypothesize someone coming out of college with amazing skills in knowing exactly what to do. From what I see even when 20-year-old startup founders get this right it's a combination of mentorship from investors and sheer luck. I despair of even imagining how to teach this skill from anything other than experience, beyond simply sensitizing a student to the fact that it is something they should be looking at as they grow as an engineer.
There was a brief window in the 1990s where the industry underwent a technological convulsion and switched away from expensive mainframes to commodity computers and the internet/web. In that brief window, which I was lucky enough to capture and ride, a fresh young whelpling who had spent the last couple of months fiddling with this newfound "web" thing could do some things that the mainframe folks couldn't. There were still plenty of lessons that could have been learned from the mainframe folks, but for whatever reason, be in the internet just not being there yet, an unbridgeable cultural gap between the hacker mindset and the IBM mindset, whatever reason, the communication and wisdom transfer just didn't happen. That hasn't happened since then and I see no prospect of it happening in the next 10 years, not because the next 10 years won't see change but because the people like me of that era have already ridden any number of waves since then and adapted and I don't see that sort of convulsive surprise happening again.
The idea that someone in their 50s just has to be old and out of date is not just silly but downright ludicrous. Getting to "well rounded" in 2022 is something that will require you until your mid-30s minimum anymore.
I think a lot of the ageism that still lives in the industry are people who are unskilled and unaware. They can't even perceive what it is they are missing, so they are incapable of recognizing the skill gap. Since a lot of the ageism probably resides in people who aren't even engineers, managers, recruiters, people who are for any number of reasons good and bad simply incapable of interacting with engineers and being able to assess their skill levels, it's a plausible guess.