Java 25: an overview of the language in your Silver Jubilee

Mariana Azevedo
The Startup
Published in
10 min readMay 31, 2020

--

The official logo of the celebration

For the first time, I leave aside articles with themes more focused on tools and tutorials, to write an editorial about a “birthday programming language” who is loved by some, hated by others, but widely used by a large number of computer professionals: Java.

This week, Oracle and the community began celebrating the 25th anniversary of Java, the Silver Jubilee as traditions say, completed on May 23, 2020. Java made this passing inside of a restricted group of programming languages that reached their “youth”, but with the merits of still being very present in the IT world today.

According to the TIOBE Index, from 2005 to 2019, the language led the ranking of the most popular in the IT world. This index is calculated monthly based on the number of lines of code written in several sources consulted in the research like available courses, third party vendors, software repositories, search tools such as Google, Amazon, and YouTube. It is estimated that we have approximately 10 million Java developers worldwide. In May 2020 version, Java is second only to the language that was used as the basis for its creation: C. And the reason for this result? C is a common language in medical devices (along with C++) and it makes sense that it is more prominent for the moment we live in (COVID-19).

TIOBE ranking on the most popular languages in May 2020

Even in the face of this prerogative and the countless “death” announcements over the years (probably Java is in the top 5 programming languages with the highest number of assassination attempts), why Java remains so popular, so used and with a job market still, so heated around the world?

To try to answer these questions, I will briefly tell the Java story, talk about the transformations that the language has gone through, in addition to content tips for those who still want to learn and go on this journey!

The Beginning of Everything

Write once, run anywhere!

The origin of Java dates back to the early 90s, when a group of engineers from Sun Microsystems, led by Patrick Naughton, Sun Fellow and James Gosling (project coordinator), wanted to anticipate a trend: the creation of ecosystems of interconnected devices, for example, a refrigerator or TV connected to computers. So, they needed a language that could be on any of these devices, that is, regardless of the platform.

Initially, this project was called the Green Project. The group’s first creation was the *7 (StarSeven), which was a remote control with a touchscreen interface and this device had a mascot that taught the user to use the control. Who was this mascot? Our dear Duke!

Duke, the Java mascot

The language with which they used to develop the control was called Oak, which Gosling gave in honor of an oak that overlooked his office window. But as the name Oak was already registered as a programming language, which forced engineers to choose another name. The name chosen was Java, about an Indonesian island from which the coffee the group consumed was imported. Have you understood the origin of the logo now?

At the beginning of the project, they did not have much support from Sun and there were no others interested in acquiring the technology at the time. Java did not enter the market until 1995, with a project called HotJava Browser (project already discontinued), to dive into the era of browsers. At that time, as there was no interactivity on the WEB pages, only static content was displayed. Thus, the idea was to create a browser to support Java applets and create a platform to demonstrate the full power of the language to the world.

As soon as this Java environment was introduced, it was an absolute success, as it had portability to any environment and multiple platforms. In addition to these two characteristics, the language is also known to support object orientation, to be interpreted (the compiler can execute Java bytecodes directly on any machine), for being robust, for being multi-threaded and the simplicity concerning the languages from which it originated (such as C).

The first Java version (1.0) came in 1996. Regarding the Core Java, it did not have many resources compared to other languages like C++, C# at the time. Gradually, the core was being improved for what we know today. For example, the concept of Enterprise only came in version 1.2 (1998). In 1.3 and 1.4 versions, we had bug fixes, with 1.4 being the version responsible for bringing Assertions.

The first Java game-changing came in 5.0 version, launched in 2004. After many years of research, were added to the language: Generics (comparable to what already existed in C++) and the challenge here was to add generic types without making major changes in the JVM; other important features, inspired by C#, such as “for each” loops, enums, autoboxing, and annotations. This version was followed by two others, 6 and 7 (without the suffix “.0”), with performance and library improvements.

The second game-changing took place in 2014, with the launch of Java 8 and the technology already sold to Oracle. Certainly, this release was the one that brought the most significant changes in the language in these almost three decades of its existence. These changes will be discussed in the next section.

The arrival of Java 8

Lambdas, Default Methods, and Streams API

Version 8 was so great that it brought more than 80 new features in its package, ranging from features already known in the famous libraries like JodaTime to changes in the virtual machine (JVM). After 10 years of version 5.0, the proposal brought here impacted the way we would write Java code.

Regarding the syntax, we had perhaps the most significant change: the adoption of elements of functional programming, offering the developer a facility to perform tasks that previously required many lines of code and were overly complex. The symbol of this process of further simplifying the language was Lambda Expressions, a feature already known to those who already work or have worked with Groovy, Scala and/or Clojure: possibility of passing functions as a parameter to other functions and not just writing methods that only take objects or primitive types as a parameter.

We also have the Default Methods feature, introduced to enable the evolution of existing interfaces, allowing the creation of these methods as bridges, without affecting the functionality of the software and without requiring that the code of the concrete classes also have to be refactored with these changes.

Another feature added to the language is a new API for handling dates/time, the Date-Time API. This API, as we said at the beginning of this section, was based on the famous JodaTime library, from JodaOrg, which was already designed on the ISO model and with much more consistent domains for the date, time, duration and periods than the old Date and Calendar classes, which nor were thread-safe and immutable as their substitutes are. The implementations are no longer in the java.util package and are now in the new package java.time.

Finally, version 8 brings a great evolution in the handling of Collections, following the principles of functional programming, with the Streams API. This API allowed all Collections in Java to be data sources for streams. All of this through the stream() method.

Few languages have made changes and huge evolutions to remain relevant, updated, and widely used. Java showed a remarkable ability to do them. From 2014 onwards, the project has evolved further, has brought, and will bring more interesting features to the language, as I will talk about in the section below.

What came next?

More performance and productivity

The next phase of Java started with the proposal to break its huge and monolithic platform and gain in modularity. As a result of a work that lasted 11 years, the JPMS (Java Platform Module System), one of the main features of Java 9, was launched in 2017. Modules in Java are independent code units to implement specific functionality. It was an important move to make the platform more organized and modularized.

From then on, we had many improvements related to performance. In addition to the JPMS, in Java 9, we started to have a different standard of the garbage collector (GC), as the G1, with shorter response times and other tunings in the JVM, such as GraalVM still in the experimental phase (which could be used with AOT compiler — Ahead of Time). In Java 10, it was already possible to use GraalVM as a JIT compiler (Just-in-time compiler) on all systems. Another interesting novelty of version 10 was the Local-Variable Type Inference, an interesting advance for those who “twisted their nose” to the language it has always been strongly typed.

In Java 11, we had a new change in the syntax of the language, allowing the local-variable type inference (from Java 10) in Lambda Expressions. Besides, we had the consolidation of a new API for the HTTP client (which had been incubating since Java 9), with the implementation of a non-blocking communication model — CompletableFuture (similar to Nodejs), enabling asynchronous communication through HTTP protocol.

Versions 12 and 13 provide improvements to the Switch statement, improvements to the GC G1, and improvements to the Application Class-Data Sharing. This last feature was created to help start applications faster and save memory when several processes are being used in the JVM.

In Java 14, several improvement’s proposals that were in preview in the last two versions became features in it, in addition to two other very interesting proposals: Pattern Matching for instanceof (second preview), to reduce the verbosity of using instanceof; and Records, which came with the proposal to drastically reduce lines of code from data classes, such as POJO classes (Plain Old Java Object) or Model classes (in MVC architectures), like in Kotlin.

Another important change that occurred in 2018, after Java 8 and the change to Oracle, is that all versions of Java started to be released every six months, to allow a faster introduction of the proposed features. These launches are generally scheduled for March and September of the same year, although they are subject to change. Following this logic, we can already wait for Java 15 in September this year!

Thoughts and tips

Like good wine, it aged well

One of the coolest things to see in the transformation of Java in these 25 years is how much the language has evolved, maintaining the same proposal and initial characteristics. Also, see how much the professionals who contribute to this transformation have worked hard to propose improvements in terms of performance and productivity. The language was born from an innovative proposal for the time and continues to try to adapt to the best of today.

In addition to everything we talked about in the past sections, it is worth mentioning two things that were crucial for the Java success: the community, which is very large and strong, and the number of frameworks also very popular that helped in its technical evolution. If we focus on the game-changing moments, especially on Java 5.0, many of the changes that Java brought at that time were already in well-known frameworks, such as Spring, for example. The criticisms that Rod Johnson (Spring’s creator) made to JavaEE back in 2002/2003, were fundamental for the language to propose to be more fluid and better. This movement has been maintained over the years.

My personal experience with Java started in college, in programming classes, and in the research groups that I participated in. For almost 10 years, the language has accompanied me (along with others, of course) and it is the one that I have mostly worked in all these years. During all this time, I heard phrases like “Java will die 10 years from now …” or “Java is so verbose, it is better to invest time in other things because no one will use more… will end like Cobol”. Well, all the data collected in the past years, the community, and its 10 million developers worldwide show the opposite, whether you believe it or not. Java has not stuck in the past, nor has it lost its essence. I venture to say that like a good wine, it has even aged well.

And for those who know almost nothing about the language or already work with Java and always want to improve your knowledge, here are some tips:

  • Books: The Core Java series, Volume I — Fundamentals, and Volume II — Advanced Features by Cay Horstmann and Gary Cornell. Excellent for those looking to know the more about the origin, concepts, and everything about Java in detail.
  • Blogs: just as the community is huge, so are the blogs. I will recommend four that loved most: Baeldung, from Eugen Paraschiv, which has an incredible amount of tutorials not only of the language but of well-known frameworks; Loiane Groner’s blog, which has several articles, tutorials and also very good courses; Javarevisited blog, by Javin Paul; and InfoQ.
  • Community: I recommend Thoughts On Java, by Thorben Janssen and SpringDeveloper, which has videos of tips, webinars, and talks about Java and Spring.

Now, it is not only a congratulation but also with a thank you for everything that language/platform/technology has provided me as experience, knowledge, and learning until this day!

It was and has been an incredible journey!

“Happy 25th Birthday, Java!”

References

  1. Java — https://www.java.com/pt_BR/about/
  2. Core Java Volume I — Fundamentals, by Cay Horstmann, Gary Cornell
  3. https://tableless.com.br/java-origem/
  4. JEPs: https://openjdk.java.net/jeps/
  5. Baeldung: Java — https://www.baeldung.com/category/java/
  6. InfoQ: https://www.infoq.com/br/java/

--

--

Mariana Azevedo
The Startup

Senior Software Developer/Tech Lead, master in Computer Science/Software Engineering, Java, open source, and software quality enthusiast.