Is boilerplate code really so bad?

It’s exhausting staying up to date with the evolution of Java and the myriad other JVM languages. Is it worth it? What do modern languages give us?

Abstract

Many JVM languages promote “less boilerplate code” as one of their selling points. Even updates to Java in recent years have removed unnecessary syntax. While this is clearly meant to be a Good Thing, many of us - particularly if we’ve been writing Java for a long time - think “so what?". Our IDEs can generate code, and our brains get used to ignoring the stuff that doesn’t matter.

Is the removal of extraneous code from the syntax of a language necessary, or just a gimmick? How does it impact our ability to write and read code?

In this talk, Trisha will explore common coding scenarios using Java and Kotlin. We’ll see what a language designed for developer productivity looks like: what’s important for developers to write (and, more importantly, read) and what can be removed. We’ll also see how Java has evolved to improve our productivity as producers and consumers of code, and why staying up to date with the features of a language like Java can ultimately make your life easier.

Videos

Also filmed at:

The code examples from this talk are shamelessly reused from Hadi Hariri’s London Software Craftsmanship Conference talk, The Importance of Syntax In Clean Code.

Slides

Code

The code lives here.

Version information

  • DevoxxUK
    • Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
    • Kotlin: 1.2.31
    • IDE: IntelliJ IDEA 2018.1.3 (Ultimate Edition) Build #IU-181.4892.42
  • QCon London
    • Java(TM) SE Runtime Environment 18.3 (build 10+45)
    • Kotlin: 1.2.21
    • IDE: IntelliJ IDEA 2018.1 EAP (Ultimate Edition) Build #IU-181.3986.9

Resources

Java

Kotlin

Groovy

Scala

Other

Presented at

Author

  • Trisha Gee

    Trisha is a software engineer, Java Champion and author. Trisha has developed Java applications for finance, manufacturing and non-profit organisations, and she's a lead developer advocate at Gradle.