Java After Eleven

Lots to talk about

The plan for today:

  • start with a Java 11 code base

  • take it all the way to Java 15
    (and beyond)

  • be amazed by how much changes

This talk is:

  • a showcase, not a tutorial

  • not a complete list

  • created with the lavish help
    of the people in Twitch chat

Java 11

  • released 09/2018

  • free support by Oracle ended 01/2019

  • free support by Red Hat until 10/2024

  • more free and commercial support available

It’s a great release…​

  • first "modern" Java release with LTS

  • solid feature set

  • stable

  • great support

…​but better things are waiting

Java 11 misses out on many recent developments:

  • thrilling new language features

  • some improved APIs

  • a few new JVM features

  • improved performance

Curious?

Let me show you how much
you’re missing out on
if you’re (still?) on Java 11.

Code

Code, code, code, code

Java 12

  • release 03/2019

  • support ended 07/2019

What we’ve seen

  • more powerful collections | Collectors::teeing

  • better async error handling | ↴
    CompletableFuture::exceptionallyCompose

What we haven’t seen

  • transforming Strings | ↴
    String.transform(Function<String, R>)

  • social media number format | ↴
    NumberFormat::getCompactNumberInstance

  • easy file comparison | Files::mismatch

  • included JDK CDS archive

Java 13

  • released 09/2019

  • free support ended 01/2020

  • commercial support available by Azul

What we haven’t seen

  • automatic application CDS archive

Java 14

  • release 03/2020

  • support ends 07/2020

What we’ve seen

  • switch expressions | ↴

    boolean bool = switch (ternaryBool) {
    	case TRUE -> true;
    	case FALSE -> false;
    	case FILE_NOT_FOUND -> throw
    			new FileNotFoundException("🤬");
    };
  • helpful NPE messages

What we haven’t seen

  • standardized foreign-memory access

  • JFR event streaming

  • OS-specific installers | jpackage

Java 15

  • released today

  • support ends 01/2021

What we’ve seen

  • text blocks | ↴

    var recommendation = """
    		{
    			"title": '$TITLE',
    			"recommendations": $RECS
    		}
    	""";
  • obvious String formattting | String::format

What we haven’t seen

  • hidden classes

Java Next

  • some features are already in preview

  • more are on the horizon

What we’ve seen

  • records | record Title(String text)

  • pattern matching | o instanceof Article a

  • sealed clases | sealed class …​ permits

What we haven’t seen

Java 11 to 15+

  • more expressive code | LOC: 2058 📉 1587

  • faster code | run time: ~ 1 s 📈 ~ 1.1 s 😞

  • better JVM | MR-JARs, GCs, packaging, monitoring, etc.

Sure you don’t want to upgrade?

About Nicolai Parlog

37% off with
code fccparlog

tiny.cc/jms

Follow

Want More?

⇜ Get my book!

You can hire me:

  • training (Java 8-14, JUnit 5)

  • consulting (Java 8-14)

Image Credits