C, Java, PHP, SQL, Python, Ruby have kept a lot of people going for more than 20 years, and will likely continue to be relevant in some capacity for at least another decade (if only maintenance, not even including new projects started with those tech stacks). I've been working with PHP and some variation of SQL for the past 28 years, and it will go on for a while longer. I've also worked in the Java world, and have done a smattering of other tech along the way as well.
Not everything lasts 40 years, but many things last more than 3-5.
But Java 2023 is quite different from Java1.
The tools you use now are different (unless vi)
You have had to learn a lot of new technologies,
frameworks, syntax to keep up.
PHP has also gone through so many changes that it is
near a different beast these days than when it first
appeared.
So if you had relied on your skills you learn as
PHP 1.0 and Java 1.0 today you would not be very productive.
Much/most of Java 1 will still compile, at least (FWIR). The evolutionary progress of java 1... to whatever it is now (current one I'm using is 17, but I know there's more past that) has largely been adding of new libraries/methods, etc, and the majority of your java skills from 10-15 years ago are still valid (although might not be the most efficient any more).
I've watched people go through Flash/Silverlight/Actionscript, multiple MS tech stacks, and many many other promising tech. Many have had to large scale reinventions of themselves and cram 'new to them' tech as the old stuff has gone away.
It's definitely easier to evolve with a tech stack over the years. You get a better sense of idioms, best practices, etc. that is hard to replicate overnight.
And yeah, some tooling is different over the years too, but yeah, vi still works :)
Shiny new 'hey look at this' ideas can pop up in newish langs, but diving deep in to them isn't often the best path for most people. The truly good and impactful ideas tend to get recognized and adopted in the more mainstream ecosystems over time, giving you most of the benefits without needing to throw out much of your experience.
> Much/most of Java 1 will still compile, at least (FWIR). ...
Actually it won't, past Java 9, as after the modules introduction it was also decided to take action on deprecation, now things get really removed after a couple of releases.
Interesting... I have a project that was originally done in J8, and... it's still working/compiling as of a couple weeks ago, but it's not necessarily as advanced as it could have been. I think we moved to J11 a few years ago, and IIRC J17 in 2022, and didn't hit any issues other than some dependency versions.
Not everything lasts 40 years, but many things last more than 3-5.