7 things I like about Kotlin
Today I know there is no single successor for Java. Instead there will be many. And the power of Java lies within its virtual machine, the JVM. (Even though a JVM is too heavy for Docker containers compared to Go binaries.)
What about Kotlin? When I heard first about Kotlin from James Strachan in 2012 I was pretty much sceptical. Groovy did not suit my taste. We’re in 2016 now and a lot happened. The language has matured and is now ready to take over the leadership as an industrial purpose programming language. Here’s why:
1Kotlin has a concise syntax
It is not as verbose as Java and not as dense as Scala or Groovy. The mixture is just right. And yes — getters and setters are gone! Finally.
2 Interop with Java
You can mix and match Kotlin with Java code. Calls from Java to Kotlin work as well as calls from Kotlin to Java. There is some impedance mismatch but it is tolerable.
3 Kotlin native
Due to Java interop it’s already possible to write Kotlin code using frameworks like Spring. At start.spring.io you can even generate a Spring Boot app with Kotlin files! And support for Kotlin will be extended in the upcoming Spring Framework 5.
5Convert Java files to Kotlin files
IntelliJ IDEA does all the hard work for you. Simply choose this conversion option and you’re done. Not really, but it’s a great start and it helps you understand the language.
6 Awesome video courses
Reading textbooks about programming languages is deprecated. Instead, check out the video courses from Hadi Hariri published by O’Reilly.
7 The fun keyword
Functions are important. So why not choose an appropriate keyword for it? function is too long and fn is too short. Using fun is a lot more fun!
So give it a try! Have fun :)