<opinion mode>
tl;dr: It’s more important to learn and understand the fundamentals than it is to specialize in any technology that uses them.
Longer answer:
I’m at the other end of the career spectrum. I’ve been a programmer for more than 40 years now. I’ve survived in a field that is always looking for the “new and shiny” “next big thing” by making sure I’ve dug beneath the surface of any topic or technology that I’ve worked with.
What this has done has been to allow me to grow and change over time by learning new technologies as how they relate to an earlier generation. (The rest is merely details.)
For example, Docker is considered a “new technology” in terms of application isolation between instances. However, fundamentally, it’s not far removed from IBM’s OS/MVT which was released in 1968. Full virtual machines date back to 1972.
Now, is my specific knowledge of OS/MVT or VM/CMS of any practical use any more? No. Not in the least. But, the fundamental concepts still apply - in many ways, the names have changed but the ideas stay the same.
Generally speaking, all technologies eventually become “obsolete” - but they don’t necessarily disappear. (My printer tape channel punch isn’t very useful beyond being a paperweight.) From the software side, there are still companies relying upon software written in COBOL, Fortran, and a host of other lesser-known languages, tools and utilities - and will be for years to come.
So what does this mean in terms of your specific question? My best answer is, “who knows?” - but that would be my answer regardless of how you framed that question.
But, if you dig into the fundamentals - as far down the software stack that you can go - and really learn about how HTML, CSS, JS, HTTP/HTTPS, TCP/IP, Python, networking, et al, all work, you’ll be prepared for whatever direction the industry takes.
Just in the past 20 years, I’ve professionally worked with Perl CGI, Java (Servlets/JSP, Spring MVC and LifeRay), PHP (Mambo/Joomla, Drupal), ASP.NET (custom development), R (Shiny), and Python (Twisted Web, Flask, Bottle, oh, and Django). And this is from being employed with just 3 companies over that time.
What has remained constant is that all these rely upon the same underlying technologies. Fundamentally, they all accept an HTTP request and generate HTML that is returned as part of an HTTP response, being transmitted across a TCP/IP connection.
So what I see is that those technologies aren’t going anywhere soon. Certainly they’ll evolve - I’ve seen JavaScript change from a simple tool used to do some primitive modifications on a web page to a full platform capable of hosting complete client-side applications. HTML/CSS has continually expanded to provide more and more features for customized, dynamic and responsive displays. And HTTP now includes WebSockets for full two-way communications - an extension of a traditional TCP socket that resides within the HTTP layer.
And that is what I believe will survive the longest.
</opinion mode>