Kotlin is statically typed programming language. It runs on Java Virtual machine or JVM. It is possible to compile it to JavaScript. The main developer of this programming language is a team of programmers from the JetBrains company, who works from a branch in St. Petersburg. The name of the language is derived from one of the Russian islands near St. Petersburg, which is called Kotlin. The magazine Dr. Dobb’s Journal named Kotlin the programming language of the month in January 2012. Although Kotlin is not compatible with Java, it was developed so it would provide interoperability with Java’s libraries and it even depends on some libraries of the core.

JetBrains company

JetBrains s. r. o. was earlier called IntellU Software s. r. o. and it is a company, which develops software for the programmers and project managers. In 2007, it had 6 branches in Prague, Petersburg, Moscow, Munich, Boston and Novosibirsk with circa seven hundred employees. Company deals with creation of development environment for a wide scale of programming languages, among which belongs Java, Ruby, Python, PHP, SQL, Objective-C, C++, C#, Go or JavaScript. New programming language Kotlin was introduced in 2011.

Creation of Kotlin

JetBrains company introduced its new programming language Kotlin in July 2011. By that time, it has been probably a year it was being developed. Dimitry Jemerov, the leader of JetBrains team, said, that his team required options in programming languages, which most of the languages beside Scala does not offer.

According to Jemerov, the Scala problem was, that the time of the compilation was too long. Therefore, through the Kotlin, they set goal to create language, that would meet the requirements of programmers and also its compilation would be at least as fast as Java compilation. Under Achache 2 license JetBrains released Kotlin as open source in February 2012.

Kotlin 1.0 was then introduced on 15th February 2016. This version is generally considered as first official stable release. JetBrains continues to try maintaining backward compatibility since this version.

The aim of Kotlin

The leader of development, Andrey Breslav, announced, that Kotlin is created the way, that it would be industrially reliable object-oriented language. It also has the ambitions to be “better language” than Java but to maintain its full interoperability with Java code, by which it should allow to the companies the sequential transition from Java to Kotlin.

Specification of the language

Semicolons are optional as end of a command, in many cases it is for the compilator sufficient sign of the beginning of new command the new line. Separating by semicolon is used only in a case, in which is convenient to place more commands on one line because of a better readability of the code.

The declaration of variables and parameter lists has in Kotlin data type as the name of the variable (separated by colon), similarly as in Pascal.

Variables can be declared as immutable in Kotlin with the help of the key word “val” or as mutable with key word “var”.

Objects of individual classes are public by default, and all classes are closed by default, which means, that derived classes are standardly blocked, unless the key word is used in base class, which allows this kind of usage.

Besides classes and methods of objects-oriented programming, which are called member functions in Kotlin, it also supports procedural programming with using the functions.

Why choose Kotlin

  • It is brief, because it dramatically reduces the amount of the repeated code, which drastically worsen the readability and makes maintenance harder.
  • It is safe, because you will avoid whole classes of mistakes, e. g. null pointer exception
  • It is interoperable, so it can use the existing libraries for JVM, Android and browser.
  • It works well with different tools, so you can choose any Java IDE or work from the command line.

¨