Tag Archives: eclipse

Learning Kotlin

This post has moved to my new blog.

Kotlin is, as described on the official website, a

Statically typed programming language for modern multiplatform applications

Programiz has a great infographic that explains the interest of learning Kotlin.

The Kotlin website has a well written documentation, with a complete language reference, as well as different tutorials.

If, like me, you have some experience in Java development, a good starting point are the Kotlin Koans. The Koans are a series of TDD exercises, each of them introducing an element of the Kotlin syntax. It starts slowly, with the basic Kotlin syntax and the differences with Java, but then goes to specific collections handling concepts that can remind you of the new Java 8 or Scala transformation methods.

To start working on the Koans, you can either fork the project on GitHub (here) or clone it directly. I’ve forked it, and created a new branch for my work (git@github.com:RemyG/kotlin-koans.git).

Then open the project in IntelliJ (Kotlin is supported and developed by JetBrains).

You can see that the project provides failing unit tests, as well as the skeleton for the classes to implement. All you need to do is implement the methods so the unit tests pass.

After having familiarized yourself with the basic Kotlin syntax, you can move to more practical experiments.

You can find good tutorials on how to integrate Kotlin with Spring Boot: Creating a RESTful Web Service with Spring Boot, Spring Boot and Kotlin.

Kotlin is also fully supported for Android development (see this blog post), but that’s not an area I’m working in.