I started developing for Android as a natural evolution from being a Java guy. The language was shared, so I decided to give it a try. And it was a choice full of sense at the time. In my personal case, this kick-off moment was in 2009.

Java was born in 1995. Since then a few versions have been published, increasing and improving its initial features, being the current version Java 8. Java was designed 22 years ago, which is an eternity considering how technology evolves, and it has currently a few flags hard to ignore. As a developer, I always experimented with other languages. The most noticeable example of a language solving some of the Java flags was Scala. The inflection point was when I saw a language like Swift in action. I do also code for iOS, and noticing how Swift was overcoming obvious problems such as nullability open my eyes on the holes in Java I had always ignored.

Due to its nature, Android natively supports all Java 7 features but only a subset of the ones present in Java 8, This supposes rather a deceleration in how the Android ecosystem can cope with other platforms. And Kotlin here is helping to fill the void.

Kotlin is a modern language (the version 1.0 was released as recently as February 2016). Its original aim was to supply the deficiencies of Java, as Scala does, but solving some of the present issues (for instance, the compiling time). JetBrains is doing an amazing job at it, and the compilation times have improved astonishingly in the last versions. As a newcomer into Kotlin, these are the answers to the questions I initially had in mind:

– Interoperability with Java: Kotlin can directly interact with Java classes and the other way around. That was a basic point: I did want to reuse my codebase and adapt it into Kotlin.

– Conversion tools: although the automatic conversion of Java to Kotlin is not to be trusted blindly, it makes a really damn good job. When I am converting Java classes, I think I can easily reuse 60%-70% of the resulting code. My approach is not to convert an entire codebase from Java to Kotlin overnight, but doing it following little steps. And the revision time after applying the automatic conversion is minimal.

Coming to Kotlin itself, it was great to experiment with something fresh after developing many years with Java. If you are a Java developer, the syntax of Kotlin comes very naturally. If you are a Swift developer it will happen the same, and you will have the benefit of understanding a few key concepts such as Nullability. The features that grabbed my attention more from Kotlin were the following:

– Nullability: telling your business that you can avoid 2/3 of your exceptions in productions is appealing. And you do not know how of a mess this is is Java until you start using Kotlin.

– Functional programming: yes, Kotlin supports functional programming, as Scala does.

– Default and named arguments: again, if you have not tried something before you can’t miss something. In Kotlin you can set up a default value for a parameter in a function, and give a name to each of them. This just increases legibility and readability of the code exponentially.

– Smart casting: tired of using instanceof and then casting the object? It always seemed to be something very redundant that could have been easily prevented. Kotlin does this automatically for you.

There are a bunch of things in Kotlin that would take a few articles to enumerate and dive in. Summarizing: Kotlin is a language that comes to supply and improve some of the Java scarcities. The learning curve is very gentle for Java developers. It is not an EITHER/OR type of question, since you can use both languages in your Java base. Kotlin will increase your productivity, and make you a better programmer in the medium and long term.