Overview of the Kotlin programming language

Following various experiments and a presentation at Mix-IT 2016 in Lyon, here is a quick look at JetBrains' new programming language: the so-called Kotlin.

Kotlin is a Java compatible programming language. It generates Java bytecode or, experimentally, Javascript.

Java 6 compatible, it brings functional programming as well as a compact and less verbose syntax than Java. Javascript or Scala developers will appreciate it for that.

Its author : JetBrains

Kotlin is developed by JetBrains and used to maintain and evolve the company's IDEs (IntelliJ IDEA, WebStorm, PhpStorm, etc).

It is here to stay and is designed and developed by colleagues, not academics who are sometimes far removed from the realities of the profession.

Benefits of Kotlin

- Functional programming.

- Type inference (as in Javascript, we can write: val foo = "bar").

- No Null.

- Operator overloading. C++ developers already know the potential of this feature.

- Javadoc in Markdown.

- Asynchronous programming (very close to Promises) via a lib, this can avoid using a lib like RxJava.

- Low verbosity syntax (shorter declarations, no accessors, etc).

- Java compatible, the two languages can also cohabit (as with Groovy): migration is made easier.

- Java to Kotlin conversion possible and assisted (quasi-automatic).

- Generates Java 6 compatible bytecode: interesting if you are stuck with a JRE6 or 7 on the target platform.

Disadvantages of Kotlin

- As in Javascript, Scala or with the Lambda of Java 8, it is easy to generate code that is difficult to read (abuse of anonymous functions, chaining and big-arrows). However, ES6 or AngularJS experts should know how to handle this.

- More bugs with Spring Framework!

- If it is easy to start a project in Kotlin, the cohabitation of Java + Kotlin is not documented enough. For example, a Maven project will have to describe two compilation phases: first Kotlin then Java, but I'm struggling to find a demo POM that works properly.

- Kotlin doesn't have much going for it if you use Java 8/9 + libs like Lombok: you have the lambdas of Java and Lombok allows you to write less code.

- Annoying default behaviour. E.g.: classes are final, so inheritance is stopped. Also, all fields have public accessors by default.

- The generated bytecode does not always take advantage of the advances in Java 7 and 8 in terms of performance and compactness (e.g. no Lambdas).

- Young project, the libraries coded in Kotlin are too rare (I know only one, which brings the equivalent of Promise).

- Functional programming not as advanced as in Scala.

- The compilation to Javascript is experimental and, unfortunately, JetBrains does not intend to go further. Functionality to be forgotten.

- There is little documentation and no guide to good practice.

- It is better to use IntelliJ IDEA or Android Studio. There is an Eclipse plugin but it is not very sophisticated. NetBeans is not supported at the moment.

- Some conversions are no longer automatic. For example, the conversion from "int" to "long" must be explicitly declared.

In conclusion, when and how to use Kotlin?

Kotlin can be interesting to modernise a project stuck on a Java 6 platform, but not on Java 8/9 + Lombok. Let's also note the compatibility issues with Spring, a blocking point for many web applications.

Javascript developers can also be seduced and use it on Android developments.

Graphical applications are also good candidates for migration to Kotlin. The asynchronous programming mechanisms are particularly well suited to the Swing EDT. After all, it is not for nothing that the JetBrains IDEs (based on Swing) have started the migration. Could this be what motivated the creation of Kotlin?

Finally, Kotlin benefits from a fashion effect as it was the case for Scala and Groovy, but this risks to pass, especially as if Scala is strongly linked to important frameworks such as Akka and Play Framework (and Groovy to Gradle, Grails or even Griffon), Kotlin comes alone. The future will tell us if a community will be created around the language.

Following various experiments and a presentation at Mix-IT 2016 in Lyon, here is a quick look at JetBrains' new programming language: Kotlin.
Kotlin is a Java compatible programming language. It generates Java bytecode or, and this is experimental, Javascript.
Compatible with Java 6, it provides functional programming as well as a compact syntax that is less verbose than Java. Javascript or Scala developers will appreciate it for that.

Its author : JetBrains

Kotlin is developed by JetBrains and used to maintain and evolve the company's IDEs (IntelliJ IDEA, WebStorm, PhpStorm, etc).
It is here to stay and is designed and developed by colleagues, not academics who are sometimes far from the realities of the business.

Benefits of Kotlin

- Functional programming.

- Type inference (as in Javascript, we can write: val foo = "bar").

- No Null.

- Operator overloading. C++ developers already know the potential of this feature.

- Javadoc in Markdown.

- Asynchronous programming (very close to Promises) via a lib, this can avoid using a lib like RxJava.

- Low verbosity syntax (shorter declarations, no accessors, etc).

- Java compatible, the two languages can also cohabit (as with Groovy): migration is made easier.

- Java to Kotlin conversion possible and assisted (quasi-automatic).

- Generates Java 6 compatible bytecode: interesting if you are stuck with a JRE6 or 7 on the target platform.

Disadvantages of Kotlin

- As in Javascript, Scala or with the Lambda of Java 8, it is easy to generate code that is difficult to read (abuse of anonymous functions, chaining and big-arrows). However, ES6 or AngularJS experts should know how to handle this.

- More bugs with Spring Framework!

- If it is easy to start a project in Kotlin, the cohabitation of Java + Kotlin is not documented enough. For example, a Maven project will have to describe two compilation phases: first Kotlin then Java, but I'm struggling to find a demo POM that works properly.

- Kotlin doesn't have much going for it if you use Java 8/9 + libs like Lombok: you have the lambdas of Java and Lombok allows you to write less code.

- Annoying default behaviour. E.g.: classes are final, so inheritance is stopped. Also, all fields have public accessors by default.

- The generated bytecode does not always take advantage of the advances in Java 7 and 8 in terms of performance and compactness (e.g. no Lambdas).

- Young project, the libraries coded in Kotlin are too rare (I know only one, which brings the equivalent of Promise).

- Functional programming not as advanced as in Scala.

- The compilation to Javascript is experimental and, unfortunately, JetBrains does not intend to go further. Functionality to be forgotten.

- There is little documentation and no guide to good practice.

- It is better to use IntelliJ IDEA or Android Studio. There is an Eclipse plugin but it is not very sophisticated. NetBeans is not supported at the moment.

- Some conversions are no longer automatic. For example, the conversion from "int" to "long" must be explicitly declared.

In conclusion, when and how to use Kotlin?

Kotlin can be interesting to modernise a project stuck on a Java 6 platform, but not on Java 8/9 + Lombok. Let's also note the compatibility issues with Spring, a blocking point for many web applications.

Javascript developers can also be seduced and use it on Android developments.

Graphical applications are also good candidates for migration to Kotlin. The asynchronous programming mechanisms are particularly well suited to the Swing EDT. After all, it is not for nothing that the JetBrains IDEs (based on Swing) have started the migration. Could this be what motivated the creation of Kotlin?

Finally, Kotlin benefits from a fashion effect as it was the case for Scala and Groovy, but this risks to pass, especially as if Scala is strongly linked to important frameworks such as Akka and Play Framework (and Groovy to Gradle, Grails or even Griffon), Kotlin comes alone. The future will tell us if a community will be created around the language.

Following various experiments and a presentation at Mix-IT 2016 in Lyon, here is a quick look at JetBrains' new programming language: Kotlin.
Kotlin is a Java compatible programming language. It generates Java bytecode or, and this is experimental, Javascript.
Compatible with Java 6, it provides functional programming as well as a compact syntax that is less verbose than Java. Javascript or Scala developers will appreciate it for that.

Its author : JetBrains

Kotlin is developed by JetBrains and used to maintain and evolve the company's IDEs (IntelliJ IDEA, WebStorm, PhpStorm, etc).
It is here to stay and is designed and developed by colleagues, not academics who are sometimes far from the realities of the business.

Benefits of Kotlin

- Functional programming.

- Type inference (as in Javascript, we can write: val foo = "bar").

- No Null.

- Operator overloading. C++ developers already know the potential of this feature.

- Javadoc in Markdown.

- Asynchronous programming (very close to Promises) via a lib, this can avoid using a lib like RxJava.

- Low verbosity syntax (shorter declarations, no accessors, etc).

- Java compatible, the two languages can also cohabit (as with Groovy): migration is made easier.

- Java to Kotlin conversion possible and assisted (quasi-automatic).

- Generates Java 6 compatible bytecode: interesting if you are stuck with a JRE6 or 7 on the target platform.

Disadvantages of Kotlin

- As in Javascript, Scala or with the Lambda of Java 8, it is easy to generate code that is difficult to read (abuse of anonymous functions, chaining and big-arrows). However, ES6 or AngularJS experts should know how to handle this.

- More bugs with Spring Framework!

- If it is easy to start a project in Kotlin, the cohabitation of Java + Kotlin is not documented enough. For example, a Maven project will have to describe two compilation phases: first Kotlin then Java, but I'm struggling to find a demo POM that works properly.

- Kotlin doesn't have much going for it if you use Java 8/9 + libs like Lombok: you have the lambdas of Java and Lombok allows you to write less code.

- Annoying default behaviour. E.g.: classes are final, so inheritance is stopped. Also, all fields have public accessors by default.

- The generated bytecode does not always take advantage of the advances in Java 7 and 8 in terms of performance and compactness (e.g. no Lambdas).

- Young project, the libraries coded in Kotlin are too rare (I know only one, which brings the equivalent of Promise).

- Functional programming not as advanced as in Scala.

- The compilation to Javascript is experimental and, unfortunately, JetBrains does not intend to go further. Functionality to be forgotten.

- There is little documentation and no guide to good practice.

- It is better to use IntelliJ IDEA or Android Studio. There is an Eclipse plugin but it is not very sophisticated. NetBeans is not supported at the moment.

- Some conversions are no longer automatic. For example, the conversion from "int" to "long" must be explicitly declared.

In conclusion, when and how to use Kotlin?

Kotlin can be interesting to modernise a project stuck on a Java 6 platform, but not on Java 8/9 + Lombok. Let's also note the compatibility issues with Spring, a blocking point for many web applications.

Javascript developers can also be seduced and use it on Android developments.

Graphical applications are also good candidates for migration to Kotlin. The asynchronous programming mechanisms are particularly well suited to the Swing EDT. After all, it is not for nothing that the JetBrains IDEs (based on Swing) have started the migration. Could this be what motivated the creation of Kotlin?

Finally, Kotlin benefits from a fashion effect as it was the case for Scala and Groovy, but this risks to pass, especially as if Scala is strongly linked to important frameworks such as Akka and Play Framework (and Groovy to Gradle, Grails or even Griffon), Kotlin comes alone. The future will tell us if a community will be created around the language.

A new project?


Contact us!

Are you interested in this topic?

CONTACT US