Java 12: “Switch Expressions gives developers a chance to clean up some of the massive switch statements & convoluted if-then-else blocks”

Share
  • March 20, 2019

JAXenter: A new Java version is out! When it comes to the still-considered-new release cadence, we tend to put the spotlight on the Java users and how they are dealing with the new status quo. But how about you, the teams behind the Java releases? How was the transition to a faster release cadence?

Donald Smith: The new release cadence has proven to be extremely effective.  We’ve been excited that features like TLS1.3 support, which otherwise might have had to wait for a year or years for a release, are already well into production since the Java 11 release.

Java 12 provides our first preview feature in the form of Switch Expressions, which will ultimately become part of the language support for pattern matching.  Meanwhile, we were able to clearly see that Java 12 was too soon for the Raw String Literals feature, and given the new cadence, we could easily decouple it for further discussion.  It’s been great knowing that it won’t be years before another opportunity comes to release it.

JAXenter: On the same note, what kind of advantages and disadvantages does the continuous delivery cycle bring to the developing experience?

Java 12 was too soon for the Raw String Literals feature, and given the new cadence, we could easily decouple it for further discussion.  It’s been great knowing that it won’t be years before another opportunity comes to release it.

Donald Smith: There are still some misconceptions around the new version numbering and what it means.  After twenty years and eight “major” version numbers, we understand it can be jarring to have four more in rapid succession.

The new release cadence means six-month releases aren’t “major”, but they’re not quite “minor releases” either.  We’ve noticed more and more that toolchains and parts of the ecosystem are getting accustomed to the cadence, what it means, and adapting very well.  For example, seeing IntelliJ support Java 12 language changes well before GA is very welcomed.

JAXenter: Speaking of the release cycle, JDK 12 will be a short-term release. Although this has been a much-discussed issue, it is always helpful to provide some reminders. Could you give us a short explanation of how short-term releases work in the newest release cycle?

Donald Smith: Simply put, a short term release is one that is superseded by the subsequent release.  So when Java 13 is released, it will supersede Java 12.  This is the way “minor” releases worked historically.  When 8u40 was released, it superseded 8u20 in terms of support and updates.

JAXenter: Let’s talk a bit about the release at hand! JDK 12 arrives with a set of new features. Which feature is your personal favorite and which will have – in your opinion – the biggest impact on Java development?

Donald Smith: As part of the new release cadence we should expect that most releases are going to be incremental and evolutionary in nature.  There aren’t usually going to be big bang features every six months like Generics in Java 5 or Lambdas in Java 8.  That’s what makes the ability to follow the new cadence so viable — the change is manageable and you don’t have to wait a long time for toolchains to catch up.  That being said, the feature I’m most keen on in this release is Switch Expressions, which will give developers a chance to clean up some of the massive switch statements and convoluted if-then-else blocks that can make code quite hard to follow.

JAXenter: Last but not least, can you talk a bit about the near future of the JDK? What’s in store for the next release? 

Donald Smith: There are currently no JEPS targeting JDK 13. Stay tuned to the JDK 13 repositories for updates as they happen!

Thank you!

The post Java 12: “Switch Expressions gives developers a chance to clean up some of the massive switch statements & convoluted if-then-else blocks” appeared first on JAXenter.

Source : JAXenter