Java 14 – “Java is very busy copying features from other languages”

Share
  • March 19, 2020

JAXenter: What do you think is the most important new feature in Java 14?

Jens Schauder: In my eyes, Java 14 is a real firework. It’s hard to decide between pattern matching for instanceof, better NPEs, switch expressions and records. If I have to decide, I’ll go with pattern matching for instanceof.

This is something that would be very practical to have in the codebase of Spring Data. Actually, I like records even more, but they are marked as “preview.”

SEE ALSO: Java 14: All the new features of JDK 14 as it hits GA

JAXenter: What feature do you think is missing in Java 14?

I believe a type system could be able to do more than Java’s is capable of at the moment.

Jens Schauder: I’m not a language designer, which is why I am not really qualified to judge what makes sense and what doesn’t. I am always impressed though when I talk to people who do. But I believe a type system could be able to do more than Java’s is capable of at the moment. I have often wished for union types. But as I said, I cannot judge what effects this would have on the language as a whole and if it would be worth the trouble.


JAXenter: Will you update right away or is that not worth it for you?

Jens Schauder: Until Spring itself uses Java 14, and we write our code in Java 14, it will probably still take a while. But we will certainly support it soon. For example, there have already been the first experiments for supporting records in Spring Data.

JAXenter: What difficulties could it pose to immediately use the new Java version in production?

Jens Schauder: As a library/framework, Spring cannot require everyone to upgrade to the latest version. Just like in the past, there will be a relaxed transition. During this time, you can use Java 14, but much older versions will still be supported. Regardless of Spring, I hope that we have put the pain of introducing the modular system behind us and that a version upgrade is now quite easy when building an application.

JAXenter: With features like “JEP 358: Helpful NullPointerExceptions“, is Java approaching “modern” languages like Kotlin?

There will always be a lot of languages that have one or the other new additional feature, but that is irrelevant as long as you don’t want to write papers about new language features.

Jens Schauder: When lambdas were introduced, I heard a fairly similar question. The languages that were mentioned then for comparison, however, were Scala and Groovy. I don’t know Groovy or Kotlin in detail, but Scala already had language features back then that go beyond what Java has now. I assume that the situation with Kotlin is similar.

Actually, though, this premise is wrong. Programming languages either fall into oblivion or they evolve and keep copying features from other languages. With the current release, Java shows that it is very busy copying features from other languages, but also very deliberately. There will always be a lot of languages that have one or the other new additional feature, but that is irrelevant as long as you don’t want to write papers about new language features.

JAXenter: What wishes/preferences do you have for Java 15, set for release later this year?

Jens Schauder: I fully trust the people who are competent in this. They have done a good job during the past ~25 years, and they will continue to do so.

SEE ALSO: Java 14 – “It feels like the early days of Java.”

JAXenter: In general, what do you think about the acceleration of Java with the six month release cycle?

Jens Schauder: I used to work in a company where a “new” Java version was used only when the old one was going out of support. Now I am working on a framework that is often used in such companies. That means I am once again working with relatively old versions, and it will take a while until I can really use the new features. So, not very much has changed. And, in general, not the speed has changed, but “only” the cadence, right?

The post Java 14 – “Java is very busy copying features from other languages” appeared first on JAXenter.

Source : JAXenter