4 minute read

Kotlin continues its rise

Next Article
News Watch

News Watch

Kotlin is a modern programming language that can be used to write applications in the Java Virtual Machine (JVM), the web, and, perhaps most significantly, Android. Significant because in 2019, Google announced that Kotlin was the preferred language for writing Android apps.

Currently, the majority of Android developers — 60% — are using Kotlin. Among developers overall, Kotlin stands at about 8% usage among developers, while Java has about 35%, according to 2021 data from Statista.

Despite low usage in comparison to Java, developers tend to love Kotlin

more than Java. In Stack Overflow

’ s 2021 Developer Survey, which sorts languages based on whether they are loved or dreaded, Kotlin is tops. About 62% of respondents love Kotlin, and 38% dread it, compared to 47% loving Java and 53% dreading it.

“I don ’t see Java as increasing its market share on Android, for sure. Java, I think will be around for a long time on back-end servers, but it’ s not going to do much on Android. The future for Android is Kotlin, in terms of native languages, ” said Andrew Cornwall, senior analyst at Forrester.

According to Roman Elizarov, Kotlin Team Lead at JetBrains, the company that created Kotlin, one reason that developers may love Kotlin is that it prevents them from having to rewrite boilerplate code.

“They hate having to repeat themselves over and over or having to, in detail, explain the same thing over and over the compiler, ” said Elizarov. that all the core constructs are concise, so you don ’t have to repeat stuff. ”

Cornwall explained that in comparison, in Java, a lot of boilerplate code is required to get things to work properly.

Cornwall says that the Java compiler “isn ’t particularly intelligent, ” which means it doesn ’t always know what to do based on the code you give it. For example, with null type assignment, in Java you might have a variable and assign null to it and then try to do something with that, while Kotlin is null safe so variables can ’t hold null values.

“Kotlin picks up on that and says, No, you ’ re not allowed to do that, ” said Cornwall.

A ccording to Android’ s website, null safety is one of the features of Kotlin that lends itself to safer code, and apps that are 20% less likely to crash.

“So Kotlin, along with Swift, are two of the newer languages that are for mobile development that are the languages that have learned from what went on before… I think both Swift and Kotlin have benefited from the fact that they were able to look at some of the mistakes that were made and solve some of those for developers, so developers didn ’t have to worry about them, ” Cornwall continued.

Elizarov explained that when Google announced Kotlin as its recommendation language for Android development, they saw really rapid growth for the language. This growth has sort of stabilized now, as there are only so many Android developers and most of them are already using Kotlin.

A number of focus items on the language ’ s roadmap may help the language expand its reach even further.

One item on the team ’ s roadmap is making sure there ’ s strong interoperability between Kotlin and existing Java code, since there are so many existing applications written in Java, especially at larger, more established companies.

“We have to pay even more attention to top notch interoperability with Java code. Because usually those big service enterprises have a lot of existing code in Java, and that puts additional pressure for us to show that Kotlin works perfectly with all that code so all those people can adopt Kotlin in the most trouble-free way, ” said Elizarov.

Another thing the team is working on is multiplatform support. It is on track to have a beta ready this spring.

“So that’ s actually going beyond JVM, beyond server-side, and our first target is mobile development so that developers can write both Android and iOS applications in Kotlin and share the business logic between both mobile applications, ” Elizarov said.

According to Cornwall, another thing that will solidify Kotlin as a big player is just time and continued evolution of the language. It’ s still an evolving language, which can cause some trouble for developers.

“People are thinking about what will improve the language, make it easier to learn, make it easier to use; there ’ s a lot of community involvement, and people are coming up with suggestions. But that creates issues. That means that as a developer, you ’ re writing for something that is moving — it’ s not standing still. ”

For example, Cornwall referenced the release of Kotlin 1.4, which introduced several breaking changes, which led to some unhappy developers when they had to rewrite their code to address those issues.

“I think having Kotlin become more stable and settled is going to help it and it will definitely make developers happier, ” said Cornwall. z

BY JENNA SARGENT

“Big service enterprises have a lot of existing code in Java, and that puts additional pressure for us to show that Kotlin works perfectly with all that code.

—Roman Elizarov, Kotlin Team Lead at JetBrains

This article is from: