(Mis)using modern Java

By Piotr Przybył

Elevator Pitch

Modern is really awesome when it comes to “Hello, World!” demos. It’s also cool for a sophisticated systems and algorithms, provided their authors write code which obeys a few fairly simple contracts and avoids obvious traps.

Description

Modern Java is really awesome when it comes to “Hello, World!” demos. It’s also cool for a sophisticated systems and algorithms, provided their authors write code which obeys a few fairly simple contracts and avoids obvious traps.

There are a few mantras regarding recent features of modern Java, such as:

  • records can replace JavaBeans everywhere
  • you never need to write hashCode() for records
  • pattern matching with instanceof is the best tool for equals()
  • just ignore--illegal-access and set it to permit
  • synchronize (new Long(42)) is the best for monitoring and so on.

Please join this session to learn how harmful following such mantras can be and how to avoid some obvious misunderstandings about modern Java.

Notes

Dear CFP Reviewers

In these 30-45 minutes I’d like to focus on the “how not to misuse Java 16” A.K.A. “how not to shoot my own foot and then blame pesky Java”. The talk will be like some of my blog posts, e.g.: * https://softwaregarden.dev/en/posts/new-java/illegal-access-in-java-16/ * https://softwaregarden.dev/en/posts/new-java/records/should-write-equals-and-hashcode/ * https://softwaregarden.dev/en/posts/new-java/how-not-to-use-instanceof/ and so on. Demos are waiting too: https://github.com/pioorg/DeepDiveJava16

Thank you Piotr