April event: Kotlin makes Java null and void

Brighton Java seemed a good name in 2012, when we started the group. But, actually, Brighton JVM would have been better. Although I guess that excludes Android, which uses Java but runs on the Dalvik VM. Naming things is difficult.

For our April 2018 event, we welcomed Android developer, Chetan Padia.  Chetan has worked on some interesting mobile projects, including Swiftkey, Beeline and the Beano app. His talk, which previously appeared at Brighton Mobile, was called ‘Kotlin Makes Java Null and Void’ (slides):

I’d been aware of Kotlin from managing an Android team recently, but I’ve not had chance to play with it. Chetan did a great job of showing why so many people were enthusiastic about Kotlin, as well as giving an idea of how easy it is to get started.  If you want a quick, non-technical intro, Wired produced a good introduction, Kotlin: The Upstart Coding Language Conquering Silicon Valley (apparently, “If it were a car, Java would feature a fast, reliable engine but not antilock brakes, power steering, or cup holders.“)

Chetan’s talk went through some of the high-points of the language – the use of optionals, the interoperability with Java, and some of the new operators, such as !!, which asserts a variable is not null. The language is designed to reduce boilerplate, with a lot of things being implicit, such as classes assumed to be ‘public final’ unless explicitly said to be otherwise.

It looks as if Kotlin is getting a traction that even scala has yet to manage. A lot of the official android examples are now shown in both Kotlin and android. It also turns out a local company has been using Kotlin with Spring.

Kotlin was originally designed by Jetbrains, who have also built the Intellij IDE. This close relationship between IDE and language means that the tooling is mature, even at an early stage in the language’s history. Oner of the nicest things is that Intellij can convert Java to Kotlin automatically. While not perfect, Chetan says that this is a good way of learning the language: “Intellij acts as a sensei”.

Brighton Java would have been better off being called Brighton JVM, and Chetan’s talk was another example of why this is. The JVM has proven to be the most interesting aspect of the Java platform, providing it with a life beyond what might have been expected from a slightly clunky language.

Chetan’s recommended resources:

Thank you to Brandwatch for providing the venue, and to West Pier Studio, who sponsored this month’s event. West Pier Studio are currently recruiting

Leave a Reply

Your email address will not be published. Required fields are marked *