Java lives as long as people write articles saying it’s dead
Java is dead. Article after article tells us that Java is dying. Java is too verbose, too archaic, it’s not evolving fast enough, it’s a terrible first programming language for a student, etc. There are plenty of valid criticisms of Java, as experts like Martin Odersky can tell you.
And of course there are also invalid criticisms from people who don’t know better, as well as from people who conflate their valid criticisms of the Oracle Corporation (which now owns Java) with criticisms of the Java programming language.
But people seem to almost unanimously love the Java Virtual Machine (JVM), which simplifies writing cross-platform programs.
The JVM has an instruction set that is in some ways very similar to those of physical chips like the Intel 8086. But if you write a program for the JVM, you don’t have to worry about whether the target device has an Intel chip or a Motorola chip or whatever other physical chip it might happen to have, as long as it has the JVM installed.
And the Java programming language is not the only language that can be used for the JVM. After all, if a compiler can take something like
for (int i = 1; i < 11; i++) {
System.out.println(i);
}
and turn it into something like
0: iconst_1
1: istore_1
2: iload_1
3: bipush 11
5: if_icmpge 21
8: getstatic #2
// Field java/lang/System.out:Ljava/io/PrintStream;
11: iload_1
12: invokevirtual #3
// Method java/io/PrintStream.println:(I)V
15: iinc 1, 1
18: goto 2
21: return
(that’s JVM bytecode represented in a human-readable format) then surely compilers can be made that take other languages (like BASIC, Pascal, Python, etc.) and produce something the JVM can run.
Martin Odersky was very well aware of this possibility, since he wrote the Java 1.3 compiler. Odersky wanted Java to have generics and lambdas, but the folks at Sun Microsystems (which owned Java at the time) were hesitant.
So Odersky created Scala, which compiles to JVM bytecode. The people at JetBrains liked Scala very much, and to this day IntelliJ IDEA with the Scala plugin is the best way to work large Scala projects, in my opinion.
The influence of Scala has made IntelliJ IDEA a better integrated development environment (IDE) for Java even for those users who choose not install the Scala plugin.
However, JetBrains wanted a JVM language that they could market. And so Kotlin was born, borrowing heavily from Scala but also with several features made specifically for the marketing team to hype.
In touting Kotlin, some programmers deride Scala as being overly “academic,” despite Odersky’s decades of industry experience. Nevertheless, hardly anyone has said that Scala would be the death knell of Java.
People have said that about Kotlin, though. Although Kotlin replaced Java as the language of choice for Android app development, and the adoption of Kotlin for general purpose programming is increasing, Java is still widely used.
How come there are so few articles about how Visual Basic is dead? Because those articles aren’t necessary. And, as it turns out, we can blame Java for the decline of Visual Basic, though it’s not a direct connection.
Microsoft has already said they will still support Visual Basic, but won’t evolve it any further other than what’s strictly necessary for it to keep up with changes to the .NET platform.
And why did Microsoft make the .NET platform, with its Common Language Runtime (CLR)?
Microsoft liked the Java platform, they saw a lot of potential in it. But, like almost everyone else at the time, they wished it had certain features it lacked. Also, they wanted Java to interface more directly with their Windows operating system.
So, Microsoft being Microsoft, they decided to just glom proprietary Microsoft features onto Java, resulting in Visual J++. Sun Microsystems, the owner of Java at the time, did not like that, and sued Microsoft.
This led to Microsoft creating the CLR, which is very different from the JVM in that the CLR can’t run Java bytecode and the JVM can’t run CLR bytecode.
But the JVM and the CLR are similar in that they both stand as intermediates between high-level languages and physical chip instruction sets, thus allowing for easier cross-platform development.
C# was created to be like Java but for the CLR, and Visual Basic, still fully supported by Microsoft at the time, evolved as another language for the .NET platform.
But, as time went on, C# became the flagship of the .NET platform, and the vast majority of new .NET programs were written in C#.
Then C# was supposed to be the death knell of Java, but that was hindered by C# being unavailable to Mac OS until 2016. In the meantime, Java had already had a couple of decades to win over Mac users.
If Microsoft hadn’t created C# to compete against Java, then maybe Visual Basic would still be a major programming language for Microsoft Windows programs.
Meanwhile, Java has not stagnated. Despite the staying power of Java 8, Oracle has kept releasing new Java versions, and increased the tempo of new long term support (LTS) releases.
Java 21, not Java 23, is the next LTS release. Since Java 1.3, the Java language has absorbed more and more Scala features. Many performance improvements have been made to the platform, improvements that can be quantified in time and money on cloud computing bills.
There are also a couple of improvements in Java 21 that Java teachers might welcome, as they provide an easier way to get students writing simple Java programs that run, hopefully making the learning curve for Java not as steep as it used to be.
Java will live for as long as there are people writing articles saying it’s dead. If people stop writing articles like that, then that’s when I’ll worry about Java becoming irrelevant.