To avoid any adverse flack, I would like to clear at the outset that I have nothing against Java 8, and I actually love Scala.

I generally don’t dabble in diverse programming languages unless my projects dictate me to, for the simple reason that I would rather master my current skill set than spreading myself too thin; an opinion to which all are free to disagree. Recently I started checked out Kotlin.

If you are like me, concerned about an ecosystem’s longevity versus the efforts put in, then worry no more. Kotlin was created by the awesome folks at JetBrains and now has the backing of the Big G as the officially supported language for Android. But Kotlin is much more than that and suitable for everything that Java can do (server side, backend API etc.)

Kotlin managed to attract my attention for its simplicity and superior Java interoperability (baggage of the past). Java got a plastic surgery in Java 8 where it painfully shoved the much demanded functional features, but the surgery went only partially well. Java 8, although a welcome change, has a long way to go before it can compete with Scala or Kotlin. Syntactically, Java 8 is way behind all the other JVM counterparts (including Groovy and Clojure).

But enough of Java rant, let’s see what makes Kotlin good. First and foremost, it can serve as a drop in Java replacement in most cases. Using Spring Boot? Spring MVC? Dropwizard? You are safe and you get the Kotlin superpowers at your disposal (Although I would recommend using Vert.x for its awesome Kotlin support and reactiveness). Kotlin is super succinct and concise (Java tautology intended). Creating a POJO is a matter of one liner, just like Scala. Kotlin provides in-built sensible defaults for toString, hashcode, equals etc., it just works. Event the methods are declared with the keyword fun

Kotlin also has the ? operator that acts like a null check crisply, but it does away with some very nice Monads that Scala provides, like the Either Monad. By leaving out a lot of Scala features, Kotlin has managed to attain impressive compile times, an Achilles's heal for Scala.

Kotlin creators were aware of the steep learning curve of Scala and wanted a stepping stone for the Java developers by adopting a minimalist Scala. Kotlin is not a full fledged Functional Programming Language.

My verdict: Kotlin will do great in the Android ecosystem which is currently infested with Java. Developers will have an easier time grapsing Kotlin than they would have had with Scala. I believe this was a big decision in Google’s endorsement of Kotlin.

I will back my arguments with code snippets and benchmarks in future blog posts as I explore the world of Kotlin.

Keep Coding! Keep Creating!