Sean Corfield wrote:I've worked with a number of JVM languages in production (Java, Groovy, Scala, and for the last seven years Clojure) but I haven't tried Kotlin yet.
Nearly all of the talk I've seen about Kotlin focuses on how it helps you avoid the dreaded NPE by introducing the idea of nullable and non-nullable versions of types and requiring explicit handling of null when "converting" between the two.
Aside from that feature, could the authors provide a short "elevator pitch" of why I should consider Kotlin, given the languages I already use?
Thank you.
Kotlin is an extreme rich language. Allow you to use Java as you always you do, plus is much less verbose than Java. And is much more readable.
The feature you mention is just the tip of the iceberg. Another really publicized function is the fact you can use data classes. Googling advantages Kotlin you are going to find dozens of advantages.
But what is really important to know is that does not come without a learning curve. The most advanced features are quite not immediately intuitive to learn.
If you know Scala and Java, Kotlin will be really easy for you. There is a growing community that is even implementing Kotlin on back end with Java Spring, and there are all the prerequisites that is going to grow.
All the people that use Kotlin that I know do not go back to Java, because once you recognize his idiomatic expressions, you will found really not convenient to write in a verbose way back in Java.
Just think over the semi columns for instance as banal example, but if you google the data class I mentioned before you will see that you do not need to write pojos anymore.
Everything become much easier, for instance you declare the constructor on the same line you declare a class, you can get rid of the returns using some = sign
Plus you will program in Android quite easy, and you will be able to understand ios as well, because Swift is really similar.
[EDIT: removed portion moved to its own topic at
https://coderanch.com/t/685992/Kotlin-Action-Huge-mistake-documentation]