Google has officially announced that it will support Kotlin as its “first class” programming language for Android development. Kotlin, which was announced back in 2011 by Jetbrains, is perfectly compatible with JAVA programming language. Like JAVA, Kotlin also runs on Java Virtual machine. Kotlin’s interoperability with Java is the main reason why it has become so popular among developers. Moreover, Kotlin is also a great match for the existing Android ecosystem and as it perfectly fits with Java, the two languages can be used within the same project. Kotlin is object oriented and designed to solve similar problems like JAVA, but in addition to that, Kotlin has many extra features over JAVA like a cleaner syntax.
Kotlin is a product of Jetbrains, the same company that created IntelliJ, so undoubtedly, the IDE support for Kotlin is amazing. Kotlin is only partnering with Google to set up a nonprofit Kotlin foundation, the language will continue to be developed and supported by Jetbrains.
Kotlin at a glance
Open Source platform
Kotlin is an open source programming language. Apart from being open source, you can convert your existing Java code with a single click tool.
Interoperable with Java
The main reason why Kotlin is gaining popularity is because of its interoperability with JAVA. It runs on JVM and used Java tools and libraries.
Kotlin’s system aims at eliminating the danger of null references from code. Kotlin has two types of references, Nullable and Non-nullable reference types that are interpreted by the compiler to give information about the correctness of the program at compile time.
When you have many parameters to keep track of, the defaulted parameters feature in Kotlin becomes quite handy. When you have functions with many parameters, you can pass arguments by names instead of index in Kotlin.
The zero overhead hgher order collections on functions, is a striking feature of Kotlin. It has concise syntax for Lambdas that makes it easy to express powerful functional programming paradigms.
Extensions functions allow you add new methods into the existing ones or new methods to existing objects, without making changes to the source code. These extension functions are statically resolved to eliminate runtime confusion or performance overhead.
Unlike JAVA, which asks you to write everything, Kotlin compiler can understand your codes and write the remaining code. It drastically reduces the amount of boilerplate code.