I'll be 42 in November, and my experience gives me a guided path to understanding and solving problems, independent of technology, language or API.
I don't need to chew through espresso and lattes until 2am, because I've gotten smarter over time. I can identify patterns and problems faster than I did 20 years ago. I work more efficiently and don't need to take a scatter-shot, unfocused approach to work.
I don't disagree that software is a continual source of frustration to develop, but I think that's because we expect at some point to be super-experts for any problem domain.
Yes, tools and frameworks change. Sometimes they suck. Sometimes they don't. If you don't love learning new things and investing yourself in continually keeping up to date, then you doom yourself to being miserable in this profession at any age.