5 min Devops

How the Kotlin programming language has conquered Android

How the Kotlin programming language has conquered Android

When Google announced in 2017 that Kotlin would now be supported as an official Android language, the audience cheered loudly. That enthusiasm has turned into adoption, as 80 percent of all apps on Android now use Kotlin. What’s behind the rapid rise of this programming language?

The development of Kotlin is inextricably linked to Java. JetBrains began developing Kotlin in 2010 to stop having to rely on Java so much internally. A new, more expressive language could accelerate the development of its IntelliJ-based IDEs. In addition to increasing JetBrain’s productivity, popularizing Kotlin would lead to IntelliJ IDEA getting increased adoption. This is JetBrains’ development environment, which before Kotlin’s rise to fame relied on Java primarily.

This ‘expressive’ nature refers to several aspects of the language. Firstly, Kotlin is a lot more compact and readable than Java. Essentially, its code is cleaner and drops a lot of the unneeded complexity inherent to Java. In addition, it offers null safety, meaning you won’t get a null pointer exception at runtime. The end result is clear: fewer bugs and a clearer, more accessible codebase.

Fully interoperable with Java

The first reason Kotlin was able to become successful stems from the fact that it is fully interoperable with Java. Dmitry Yeremov, one of Kotlin’s early developers, noted back in 2011 that the move from Java to Kotlin would take place gradually.

Programmers have made this move, too. A JetBrains survey in 2023 showed that 79 percent of Kotlin users surveyed have made the jump from Java. For only 3 percent of users, Kotlin is their first programming language.

Its success was built on interoparability with Java, clear documentation and, as Google believes, excellent IDE support. That company announced during Google I/O that it was 100% behind Kotlin, with full support in Android Studio and “holistic support” for the language throughout. Before the announcement was made, 20 percent of Android app developers were already using Kotlin.

Why did Kotlin break through?

Alternatives to Java already existed. Scala, officially released in 2004, is also interoperable with Java and was designed to address many of that language’s shortcomings. However, Scala is seen as inaccessible and overly complex by critics, meaning code is hard to read. More importantly, it requires a lot of adjustment from what’s familiar. An abundance of unfamiliar concepts is said to drive programmers away. Although Scala is interoperable with Java, the language was not developed to support it specifically. One of the telltale signs of this being the case is that users need to move away from the Java ecosystem altogether to fully utilize Scala.

By contrast, Kotlin benefits from its similarities to Java. Programmers are familiar with the earlier language’s concepts and are especially pleased with the improvements made to it. In other words, it is an evolution of Java rather than a revolution. In addition, fast readability is key for mainstream adoption. Ultimately, all the extra features and usefulness included in Scala means very little if it pushes beginners away, meaning it is doomed to a niche due to the high initial learning curve.

Meanwhile, the primary language

In 2019, Google described Kotlin as the preferred language for app development on Android. “Android development will increasingly be Kotlin-first,” the company stated at the time. Within two years, the programming language had set the new standard as far as Google was concerned. At the same time, Google’s support caused a massive increase in Kotlin usage. “If you look at a Kotlin new users graph, you immediately notice the two most significant spikes – one in May 2017 and another in May 2019,” said Kotlin Product Lead at JetBrains Egor Tolstoy.

“We have an inside joke about it: ‘Marketing a programming language is easy. All you have to do is make the largest operating system in the world call it an official language during the annual keynote.'”

In short, there is no denying Google’s key role, regardless of Kotlin’s benefits. Actually, the name ‘Scala’, a reference to the “scalability” of the language depending on the number of users, actually fits Kotlin better. The original, gradual introduction allowed JetBrains to create a good foundation for the language, which was used to skyrocket it to global fame thanks to Google’s assist.

Android having become the home of Kotlin is also made clear by its usage figures. 66 percent of all Kotlin users develop Android apps with it. 83 percent of those surveyed have begun using the language only after Google put it on a pedestal at the company’s I/O 2017 keynote. Interestingly, the adoption of Kotlin has come predominantly from developers themselves (62 percent), so the growth of the language seems relatively organic beyond the good PR.

Some criticism, but mostly positive

Although Kotlin has, in some ways, taken over the role of Java, it has not overtaken the old language on all fronts. For example, Java’s IDE experience is still perceived as superior and its documentation is still more extensive. As with fellow programming language Rust, Kotlin users complain about long compilation time as well.

Yet several comments indicate that very few people are looking back very much at all. As one experienced Java developer puts it, “As much as I enjoyed working with Java in the past, having experienced such a pragmatic and productive language, I just can’t allow myself to be held back in such a severe way now that I see what’s possible.”

Also read: Why the Rust programming language keeps getting more popular