At avisec we decided to use Kotlin when we started to rewrite our backend service. This has proven to be a very good decision. Here are my top 10 reasons why I do love Kotlin:
- Data classes eliminate a lot of boilerplate code.
- The nullability support of the compiler forces you to think about nulls everywhere. This reduces the number of NullpointerException related bugs to a minimum.
- The lambda syntax is very, very lean.
- No more guessing which functional Java interface to use.
- The standard library provides is a great help.
- The IntelliJ support is seamless.
- Java and Kotlin integrate both ways – you can start writing Kotlin code in Java projects today, no big deal.
- Return values are supported for most (?) structures: if, try/catch, when
- Assign default values to parameters and used named parameters when calling functions.
- Generics in Kotlin are more powerful than in Java.
Let’s hope the current adoption rate of Kotlin continues and it will become a widely used alternative for Java on the JVM.