I am over 40 right now, and, frankly, I don't see too much of this problem right now.<p>As you get older, you need to understand that you need to adapt. It's easier to get in the trap of thinking that the old ways are better (and sometimes, indeed they are), but it doesn't matter. You have to go with the flow.<p>Another important thing is that you shouldn't get too attached to technologies. Move with the times, be aggressive with learning.<p>Appreciate new languages, new paradigms. Yes, it sucks when you spent hours honing your skills with Hadoop and then one day you find out that all the cool kids are doing spark. But, the thing is, the people that are doing spark now are the people that were doing Hadoop yesterday, some of them even older than you. It was you that got in the comfort zone and didn't see that the field was evolving.
While you were satisfied doing Hadoop, some people were thinking of how the job could be done in a different way.
And I am not telling here that you should be doing open source, but you should have kept yourself on the loop.
It is not unfair, and it's not unique to our profession. there was a time where lobotomy was the hot thing on psychiatry, people probably spent hours honing their skills on it, and then, someday, science evolved and we figured out that those skills were not only useless but also dangerous. Maybe this happens way faster in our profession, but also it is a lot easier for us to keep ourselves current on the state of the art than for a surgeon.