The biggest news on this year's Google I/O 17 was that Kotlin has become the official language on Android. Google finally heard the voice of the community which has been calling for the support of Kotlin for several years already.
Kotlin – A language we should know of
Kotlin has gained a lot of popularity in recent years, and was favoured by Android developers who appreciate the benefits of modern language in application development. However, Kotlin is not just usable for Android, although it is the area of its current boom. You can also use it when writing web applications, servers, etc. Even more, Kotlin Native has been recently launched, which allows compiling for platforms where VM is not available, such as iOS.
I was pleasantly surprised when I found out the possibilities Kotlin offers to developers and its ways of making our code cleaner and speeding up the development process. My first intention with Kotlin was to evaluate this language and determine the best way to use it for the requirements of our development team. At this point, we use Kotlin as the main programming language for Android application development. I also used to work with Kotlin when writing Microservices.
What is Kotlin
- focused on interoperability, safety, clarity and tooling support
- no semicolon required 😉
- officially supported language for Android application development since Google I/O 17 (you can still use Java if you wish of course)
- Kotlin is null safe, that means that you deal with possible null situations in compile time in order to prevent execution time exceptions
- you need to explicitly specify if an object can be null
- Kotlin is basically an object-oriented language, not a pure functional language
- it uses many concepts from functional programming, such as lambda expressions, in order to make code easier
- Kotlin has a number of features for increasing the effectivity when working with collections
- you can continue using libraries you already have written in Java because the interoperability between those languages works very well, which is one of the main goals of Kotlin language
- you can extend any class with new features even if you do not have access to the code of the class which you are extending
Where to Start
- Try.kotlin.org – try using Kotlin online in a browser or you can go through small tests called Kotlin Koans
- Slack – Kotlin is on Slack
- Full Kotlin Reference Documentation
- CZ Kotlin User Group
- Look at the video from the eMan Kotlin Meetup which took place in May
Next time I will tell you about the Top 10 Kotlin Features (at least according to me). What do you think of Kotlin and what experience do you have so far? It would be great if you leave a comment below.