Even as more programming languages develop, Java seems to be getting a lot more widespread year on year. So, why is it still popular after 24 years?
Having celebrated its 24nd anniversary in 2019, Java has experienced consistent development in its programming efficiency for decades. It is one of the most popular programming languages around the world and is designed to keep running on any stage consistently.
But at the same time, Java is probably one of the most “love to hate” languages out there. According to statistic research it is the 2nd most hated language among the participants (statistically insignificant, but still noteworthy), only 2 points behind PHP. Certainly not a great place to be.
There are many reasons why not to like Java, but there are also quite a few good reasons to learn it, even if you don’t like it. Actually there is an increasing number of reasons to start trying to like it again, or at least to hate it less.
Firstly, reasons why Java is and will continue to be a strong choice:
Java is still the most popular language – and this means it has the most developers, most ongoing development, largest installed base etc. There is no sign of any sharp decline – if you look at the TIOBE trend for may 2020 for example it could easily continue to be No.1 or 2 for the next 10-15 years.
Java, despite its flaws, is still an excellent language for developing enterprise applications. The fact that it is verbose and tends to promote a fairly standardized style of OOP development is a good thing when applications need to be maintained by many different developers over many years in a fairly standardized way. Smart CIOs realize this, which is why you won’t see Java disappearing in the enterprise any time soon. BTW, and explicit goal of Java when it was created was that it should be “simple, object oriented, and familiar”.
One of the biggest reasons why Java is so popular is the platform independence. Programs can run on several different types of computer; as long as the computer has a Java Runtime Environment (JRE) installed, a Java program can run on it. Most types of computers will be compatible with a JRE including PCs running on Windows, Macintosh computers, Unix or Linux computers, and large mainframe computers, as well as mobile phones. Since it has been around for so long, some of the biggest organizations in the world are built using the language. Many banks, retailers, insurance companies, utilities, and manufacturers all use Java.
The success of languages is not just about the language itself, but around the ecosystem of libraries available for the language. In this respect, Java is second to none, with a massive array of open source and commercial libraries.
Steve Zara, a programmer for more than 40 years, describes how there is no sign of Java declining in use. Instead, it is an evolving language which almost uniquely combines stability with innovation. Highlighting the longevity of the language, Zara states that the code you may have written 15 years ago will run on the most up-to-date JVMs and gain the speed advantage of the latest profiling, native code translating, and memory management.
Java is fundamentally object-oriented. The code is so robust because Java objects contain no references to data external to themselves. The language is considered to be very simple; however, it comes with a library of classes that offer commonly used utility functions that most Java programs can’t work without.
Java API, the class library, is as much a part of Java as the language itself. In actuality, the genuine challenge of learning how to use Java isn’t learning the language, but learning the API. The language consists of 50 keywords, but the Java API has thousands of classes with tens of thousands of methods you can use in your programs. Despite this, developers aren’t expected to learn all of the Java API, and the majority of them are only experienced and fluent with a small portion of it.
Performance – JIT compiled code on modern JVMs runs very close to optimized native code in terms of speed. In practice, this means that Java is typically one of the fastest language/implementation combinations available. Anyone who thinks that Java is slow (or, for goodness sake, “interpreted”) needs to update their facts from the last century.
Major corporate backing – Java is a strategic platform supported by many of the world’s largest and most important technology companies and organizations – we are talking about Google, Oracle, IBM, the Apache Software Federation etc. Java also has substantial support from major users of technology – banks, media companies etc. No other language/platform has such broad industry support (even if the players have the occasional tiffs).
Android – is giving a major boost to Java in the mobile space. Lots of startups are targeting this, and it’s not unreasonable to expect that mobile startups will also have good reason to pick Java on the server side as well.
Portability: Java is the closest thing in existence to a genuine cross-platform programming environment. It’s on everything from high end servers to smartphones, and compiled pure Java code will run unmodified on all these platforms. Very few languages can say this with the same degree of credibility. Also as a bytecode language, Java has an inherent advantage in the library space because compiled libraries are inherently portable across platforms.
Excellent tools – most of which are free and/or open source. Netbeans and Eclipse are great examples in the IDE space. Developers need good tools to be fully productive, so this is an important factor in language/platform choice.
Java is Open Source – not going to go into why this is a good thing here, but suffice it to say that both: a) the core Java implementation in the OpenJDK and b) most of the interesting Java libraries and tool are open source.
Java is not just a language, it’s a platform: there are many promising languages on the JVM such as Clojure and Scala that represent the future of the platform on the language front.
Secondly, how will Java get replaced? Let’s look at the alternative contenders:
C/C++ – will continue to be important in terms of systems programming and for highly optimized native code requirements such as gaming. But that will continue to be a specialized niche and will never take them past Java, which is more suitable for general purpose application development.
Microsoft.NET – C# is a nice language for sure (an improved/polished clone of Java, in essence), but the entire .NET platform represents vendor lock-in to the Microsoft software stack. A large number of people will never adopt a vendor-specific strategy having been burned by this in the past. Mono, despite being a nice open source project, is never going to be fully compatible so most businesses won’t bet on this as an option. .NET/C# will continue to be very important in the windows space, but won’t be able to displace Java overall.
Objective-C – will no doubt continue to occupy a major niche in Apple-specific development, but probably won’t have much traction outside that space. Also, Java has a very compelling counter-story in the mobile space thanks to Android.
Python, Ruby – nice languages again, very productive in their niches. But nowhere near the JVM in terms of performance, industry acceptance or range of libraries. Will continue to be successful for sure, but they aren’t shaping up to be Java-killers.
Haskell, OCaml (and various other academic/FP languages) – great languages, but have nowhere near the library support Java has, so not particularly practical for real-world usage. Also, offer no compelling advantages over JVM languages such as Clojure or Scala (which can use Java libraries painlessly)
Clojure or Scala – actually really compelling in the medium/long term. Might actually replace Java in 10-15 years, but both really count as part of the Java platform anyway since they are JVM languages. So Java investments will be safe.
Mysterious unknown new language? – might happen, but history has shown that no matter how compelling a language is, it takes a long time for traction to develop, developers to learn new skills, significant investment by companies to happen etc.
As we enter a new decade in 2020, Java is more than ever a programming language to learn. Whether as a first language or to broaden your programming skills, Java will bring you a lot and will be a significant asset to your career.
Of course, Java is not always the most appropriate language for each domain in the computer industry. Nevertheless, Java has the advantage of being versatile while benefiting from an execution platform, the famous JVM, extremely powerful which will give you the possibility to create high-performance and scalable programs. So, if someone can provide some contra arguments it will be interesting to listen, thus feel free to share your thoughts in comments.