Skip to content

This is how Kotlin became the reference language for Android developers

27 mayo, 2021

Kotlin has become one of the fastest growing programming languages ​​on GitHub, and the number of people who have had to work with Kotlin code has increased from 3.5 to 5.8 over the last year; Let’s add to that being one of the five most loved by developers who use Stack Overflow.

But, beyond that, the great achievement of this language born only four years ago has been to unseat the ancient but popular Java language, having conquered the hearts of even the creators of Android: in May 2019, Google declared Kotlin its preferred programming language for Android application development.

And it’s not just a matter of Google or thousands of programming fans: large companies are also choosing to switch to Kotlin to develop their applications: Duolingo, Pinterest, Uber, Evernote, Square … in total 70% of the 1000 most used apps on the Play Store are developed in the language developed by JetBrains.

Android 12 Preview – How to install step by step

Simplicity, interoperability, performance, and exception handling

Kotlin shares a feature with other young languages ​​that are gaining popularity in recent years, such as Python: the commitment to simplify the syntax without sacrificing functionality.

Google launches a free Android and Kotlin course to learn how to program applications without any previous experience

Being the development of apps a sector that continues to need a great contribution of human capital throughout the world, this simplicity helps make it more popular over options like C ++ and Java.

According to some estimates, resorting to Kotlin can reduce the number of lines of code by 40% versus its Java equivalent, in part because it is able to more concisely express what you want the device to do.

In addition, another great advantage of Kotlin is that it is able to cope better one of the big problems when programming in Java: the so-called null pointer exceptions, which occur when trying to use a reference that does not point to anywhere in memory and which is capable of blocking applications.

But even so, a language like Kotlin would have had a very difficult time ousting Java when much of the code written for Android was already written in that language. That’s where full interoperability between both languages ​​comes into play.; as we can read in,

“Existing Java code can be called from Kotlin in a natural way, and Kotlin code can also be used from Java without problems.”

The syndrome of living in fear of becoming a rusty programmer

This is making it easier for the code written in Kotlin to have to resort less to libraries written in Java, allowing the use of a pure Kotlin that runs more fluently than one that includes legacy Java code because you can bypass the JVM and resort to compiling for LLVM (the low-level virtual machine).

In this way, any impediments to getting on Kotlin’s ship are erased with a stroke of the pen, either with new projects or with those that have been in development for a long time.

What’s more, Kotlin is not a threat to Java only in the Android domain, but it is a general purpose language, which has seen great growth also in areas such as server-side development or data science … and now is about to assault iOS too, thanks to the launch, less than a week ago, of a tool called Kotlin Multiplatform Mobile.

Via | GadgetsNow