Kotlin – A language we should know of

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 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.

Source: Google

Source: Google

I personally started with Kotlin 2 years ago and I must say I have been a big fan of this language ever since. At first I was mostly interested in its interoperability with JavaScript. The possibility of using Kotlin as a replacement of JavaScript for mobile hybrid development was very attractive to me and my team.

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

Kotlin is a pragmatic programming language for JVM, Android and JavaScript. It is an Open Source language created by the JetBrains company

  • statically typed programming language targeting JVM and JavaScript
  • focused on interoperability, safety, clarity and tooling support
  • similar to Java/C#/JavaScript/Groovy
  • 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)

Safety

  • 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

Functionality

  • 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

Source code

1. obr. 2

  • Kotlin has a number of features for increasing the effectivity when working with collections

Interoperability

  • 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
  • naturally, you can use both languages (Java & Kotlin or JavaScript & Kotlin) within the same project

Extensibility

  • 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

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.

Vaclav Souhrada
Kotlin & Android Developer at eMan, Czech Kotlin User Group Founder and Organizer

RSS