JavaScript won the war of running the same language on both sides, because it runs in the browser, and you can run any language you want on the server. You can't practically run any language you want on the browser, only one, and it's JavaScript, so it's not possible for Java to run on both sides now. And in case you didn't notice, people run JavaScript on the server all the time, because they can share the same frameworks and libraries and data structures on both sides, like easy server side rendering. The cost of developing and deploying and running and maintaining two different languages and implementations of everything and incompatible frameworks on each side is just too high, and a huge waste of energy and time and human effort. Java usage is declining and stagnating, and JavaScript/TypeScript usage is rising rapidly. And JavaScript's and TypeScript's future is not controlled by Larry Ellison.
>In a similar vein, Java — a language central to the emergence of the software industry as we know it today — increasingly appears to be past its prime.
>Java slipped out of the top spot on the TIOBE index — a position it had held for nearly two decades — a couple of years ago. As of 2023, there's every indication that Java won’t recover the top spot.
>Although Java will likely remain widespread over the coming year, it's hard to imagine it returning to its former stature as one of the most popular languages. On the contrary, we suspect Java will continue to decline in popularity over the coming year and beyond.
>50+ JavaScript Statistics For 2023 Trends & Facts
>Microsoft introduced TypeScript in 2012 as an extension of JavaScript, incorporating optional typing. This adaptation retained the syntax and essence of JavaScript while implementing supplementary features essential for developers. The contrast between JavaScript and TypeScript is noteworthy, as the latter presents heightened productivity and simplified maintenance for expanding codebases.
>For this reason, TypeScript transcends being merely a fleeting JavaScript trend; it has evolved into an established language. The most recent survey from 2022 indicates that JavaScript stands as the most utilized programming language, boasting a considerable 78% adoption rate among developers. This survey stems from the State of JS Survey.
Nobody is denying the popularity of Javascript. I'm merely pointing out that Java is huge. Java is still incredibly popular in enterprise environments, and so much Java code has been written there that I've called Java the COBOL of the future on several occasions. It's still very easy to find work in Java.
> You can't practically run any language you want on the browser, only one, and it's JavaScript
Everybody knows that, but are you aware of the history of that? Why Javascript is called Javascript, despite not being in any way related to Java?
Java was originally aimed to run in the browser as Aplets. That required a plugin of course, and those have since fallen out of favour for good reason. But Java was originally the language that ran in the browser, and Sun specifically marketed it for that. And then Netscape introduced their own language called Javascript specifically so people would associate it with Java, but it had the advantage that it would run in the browser without the use of plugins. And Netscape was so dominant that they could dictate this sort of thing.
Plenty of Web Aplets have been written at that time, but with browsers abandoning plugins, they've become obsolete. And requiring a plugin before it runs was definitely an obstacle.
Instead Java became the preferred language on the server, and it took a very long time before Javascript got any traction there. It has that traction now, and the advantage of running the same code in browser and server is definitely an advantage, but there's a lot of history before that.
And while Java's popularity is certainly dwindling (and deservedly so, if you ask me), it's coming from an extremely high popularity and has a very long way to go before it's gone. Because it did win almost everywhere outside the browser.