Java: From Beloved to Outdated - The Rise and Fall of a Programming Legend
Unsplash

Java: From Beloved to Outdated - The Rise and Fall of a Programming Legend

Hey there! Today we’re going to talk about why Java was loved 20 years ago and disliked today. Java has been around for nearly 30 years, and 3 billion devices run Java since 1997.


Now that newer JVM languages such as Kotlin and Scala are popular, has Java become obsolete? Did people hate Java? Well, let’s dive in and find out!


Why Java was so cool back then


Back in the day, Java was the bee’s knees. Let me tell you why!


  • Platform independent - Java’s code could run on multiple platforms without any hassle.
  • Similar syntax to C and C++ - Java shared a similar syntax to C and C++, which allowed programmers to switch to Java without having to relearn everything.
  • No more pointers - Java eliminated external handling of pointers, which meant no more annoying segfaults. Java used pointers (of course), but the code was abstracted in various ways.
  • Automatic Garbage Collector - In Java, the garbage collector automatically frees up unused allocated memory for you.
  • Object-Oriented Programming - Java was a purely object-oriented language, which related to real life well.
  • Clear structure - Java’s syntax was very structured, which made it easy to understand related information and functions.


Java was so popular among programmers, and there was no reason to hate it. Java was the language in the 2000s. Multiple government software and banks used Java, and some of them still do.


What happened to Java?


Although Java is still maintained, and there are still many Java developers across the globe, the past glory of the language is now gone. Here’s why:


  • Nullity - Java’s adoption of the use of null in the core library, makes it similar to handling segfault errors in C.
  • Rigidity - After programming in Java for a while, you would notice you write the same code multiple times, making it bulky.
  • No functional language support - Java was purely object-oriented. However, programmers required features involved in both imperative and declarative languages.
  • Flaw in Inheritance Abstraction - There was no way to allow access to sub-classes and restrict access to other classes in the package.


Java 8 to the rescue


Java maintainers did not ignore the requests of developers. With Java 8, they introduced functional interfaces with the Stream API, and the Optional<T> class was a workaround for the nullity problem.


But wait, there’s more! Java 12 introduced switch expressions, which reduced some of the boilerplates in conditional control flow. Java 16 introduced records that remove much of the boilerplate while writing POJOs (Plain Old Java Objects).


The on-coming of Kotlin and Scala


Like Java was created to be an improvement over C++, Kotlin is created to be an improvement from Java. Kotlin has reduced boilerplate greatly and ingrained null-safety. It also introduced string templates, sealed classes, a multi-paradigm language, operator overloading, data classes, and other miscellaneous features like extension and inline functions, and coroutines.


Conclusion


Java was the star programming language, and we cannot overlook how it helped transform programming languages today.


Java was built to solve some problems and, as a side effect, created new problems. Just because something better came along, it does not mean we hate Java.


The way I see it, 10 years down the line, people will start complaining about today’s languages and a new language would be created to address those problems. If you hate Java, remember that if it was not for Java, modern languages would not be as powerful as they are today.


So, that’s it folks! That’s why Java was loved 20 years ago and disliked today. What do you think?

Kevin Parkings

Senior Java Developer / Architect - REMOTE EU - Available April 2025 (updated 24 feb)

1 年

In reality kotlin is making progress in the market and is popular with the new generation of developers but java is still by far the more popular of the three There are still more greenfield projects with java than kotlin and what we see now is where kotlin is used on a new project its a combination of java and kotlin Long term If one of the newer jvm languages surpassed java as the dominant language I would bet on kotlin. However this will not happen for a very long time. Im sure that java will see me to the end of my career, even If towards the end its only maintaining the existing applications ( same situation as cobol developers are in now) What will help kotlin is that it can be used in the spring framework making a switch from java to kotlin a simple process for existing java developers

要查看或添加评论,请登录

Marco Antonio Uzcátegui Pescozo的更多文章

社区洞察

其他会员也浏览了