How Kotlin Makes Your Java Code Better

By Andy Balaam

Concrete examples, based on real-world code, of how converting Java code to Kotlin improves it.

We will cover:

  • Reducing the amount of code for common patterns like value objects and default parameters

  • Preventing errors using immutability, null safety and explicit inheritance

  • Expressing ideas more directly using pattern matching, sealed classes and conditional expressions

  • Less verbose functional-style code like streams and lambdas

  • Clearer object structure with primary and secondary constructors

One of the joys of Kotlin is how easy it is to make a gradual transition from Java. All of the examples will demonstrate code that can be dropped in to an existing Java code base with little or no disruption.

If we have time, we’ll discuss things we wish were in Kotlin, and whether any of them are plausible on the JVM platform.





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.