Hacker News new | ask | show | jobs
by kcorbitt 3887 days ago
I've been using Kotlin on Android for about six months, and can't recommend it highly enough. If you're stuck in the Java ecosystem, Kotlin will make your life much better.

I also recommend it for people coming from the world of dynamic typing (Ruby, Javascript, Python, etc.). If you can appreciate the guarantees of a static type system -- and I submit that anyone who has worked on a project of more than a few KLOC can -- give Kotlin a try. It's much less verbose than Java, and gives you the tools and constructs to program in much the same style as you would in a dynamic language, but with extremely good compile-time correctness checks. It may not be Haskell, but it's pragmatic, practical and productive.

The tooling is also world class, as you might expect from a language developed by JetBrains. I recommend using Kotlin with IntelliJ -- the intellisense is guaranteed to boost your productivity.

Seamless Java interop has been a huge priority for the developers, so the ecosystem is also quite good. Its biggest weakness (for my use case anyway) is the lack of a good, modern web framework. Hopefully now that Kotlin is more stable a native library ecosystem will emerge that plays to Kotlin's strengths more than Java's.

2 comments

The language is promising, but given the incredibly fucked-up state of the Android build tooling merely getting to the point where you can evaluate Kotlin is an exercise in extreme patience.

> The tooling is also world class, as you might expect from a language developed by JetBrains. I recommend using Kotlin with IntelliJ -- the intellisense is guaranteed to boost your productivity.

It's a sad state when IntelliJ can be considered "world class". Sadly, I've had nearly as many problems with it as I have with Eclipse. I've been thrashing about desperately trying to find any production-ready alternatives to straight Java for Android development. I will literally cry tears of joy when I do, but it's not going to be today.

How does it affect built time and the feedback cycle?
Build times are supposed to be comparable to Java.
Build times are used to be slower, but I think recent Kotlin compilers have "daemon" mode to speed things up.

I personally use Kotlin on a daily basis for Android development and build time is comparable to the one of Java. May I also recommend Anvil framework (https://github.com/zserge/anvil)? It brings declarative layouts and data bindings, which works best with the immutable data types of Kotlin (much like React does in the web).

I also highly recommend Anvil. Anvil + Kotlin makes Android development feel sane and at times even joyous! I should write a blog about my experiences.
It's slower.
It depends how you use it.

At the moment the gradle plugin doesn't do incremental compilation. If you use it for Android, that's an issue because of the Android build system.

I use Kotlin for free standing programs that run on my laptop/desktop. In these cases it's about as fast as Java, but that's because IntelliJ controls the compilation itself and gradle/maven is used only rarely.