From Google launching support for the Kotlin programming language in Android a year ago, to over 100,000 respondents of the StackOverflow survey voting it the second most loved language, JetBrains’ baby is thriving.
We wanted to investigate this growth further so at the beginning of the year we ran a survey on Kotlin ecosystem, asking developers for their thoughts, opinions, and experiences, about the language.
While we initially aimed to gather 1,000 responses, we were overwhelmed to hear from over 2,500 developers from all around the world. We compiled their responses in the State of Kotlin 2018 report.
We use Kotlin a lot at Pusher — for every Android SDK created since 2017 and for our new products Beams, Chatkit, and Feeds. We noticed a significant uptick in Kotlin usage among people who create new applications using our core product, Channels in the recent years, so we decided to go with Kotlin in our new SDKs. We also wanted to learn what makes developers love Kotlin so much.
The Developers Who 💓 Kotlin
To understand the insights, it’s good to look at the demographics of our respondents first, so we know their background:
72 percent of respondents are employed — ie working for someone other than themselves; 11 percent are self-employed or freelancers, and 15 percent are students.
When it comes to experience, the numbers tell a similar story to some other surveys, such as the recently released StackOverflow survey: over 50 percent of our respondents have been working as developers for less than five years, with a third working between two and five years, and 22 percent having between five to 10 years of experience. Almost 10% have less than one year of experience.
In terms of where these people work, we’ve seen technology as a clearly dominating sector — 77 percent of our respondents work in the tech industry, followed by finance (12 percent), education (11 percent) and digital agencies (9 percent).
One-third of respondents work in companies where two to five people program in Kotlin. This roughly matches an average-sized team (Android would be really common).
Key Results and Insights
Now that we’ve looked at who our respondents are, we can dive into the more interesting parts of the survey, the insights:
- Google drives the Kotlin adoption
Kotlin first appeared on my “personal radar” as a tiny blip sometime around 2013 or 2014, when I read that JetBrains is creating a new programming language. Naturally, I dismissed it as a Java ain’t going nowhere thing, and moved on…until the usage seemed to blow up in 2015, starting with Jake Wharton’s white paper advocating Kotlin’s adoption at Square.
Unsurprisingly, that’s what our graphs show as well — adoption exploding in 2017 after Google announced first-party Kotlin support for Android.
That’s especially remarkable with the student and more junior developer populations, as they haven’t looked at Kotlin earlier than then.
- Kotlin is a superstar among Android developers.
- Kotlin is picking up steam rapidly, but JetBrains resources are incredibly important.
Our findings show that although most people learn about Kotlin from multiple resources, Kotlin’s official documentation and the resources produced by JetBrains are incredibly important for pushing it, with over 53 percent of responses belonging to JetBrains’ resources — from their official website and learning material, to the Talking Kotlin podcast, and the Kotlin in Action book written by JetBrains engineers.
Also unsurprisingly, almost 90 percent of respondents cited the official website kotlinlang.org as the most popular resource.
Outside of JetBrains’ bubble the largest individual resource for learning Kotlin was the Kotlin Weekly newsletter with 15 percent of respondents.
We haven’t asked about Google resources, so it will be interesting to see the difference in uptick from their resources in State of Kotlin 2019.
- Looking deeper into what exactly makes Kotlin so popular we unveil favorite features:
Null safety, extension functions, Java interoperability, and data classes are by far the most popular features, with each of them being loved by at least 60 percent of respondents — with null safety clearly dominating at 80 percent.
When it comes to barriers to entry, Kotlin’s extension functions take the prize. They are quick to get started with, and even quicker to notice their benefits, by replacing Util classes and similar:
- “I use them where I would usually have written a utility function, though the neater syntax does lower the bar for when I choose that solution.”
Although, it’s not all perfect, as too many of them can make the code hard to read or maintain:
- “I try to avoid extension functions, since they can “rip the code apart” i.e. place logic that belongs together in different places.”
On the other side of Kotlin’s most popular features list we have the two features that are still under active development: coroutines, and multiplatform support.
Coroutines bear a promise to become the next best way to do async programming, something we’ve struggled in the past, especially on Android, where a lot of people still use RxJava solely for the purposes of threading.
- “All async work — Android Room (db) — Android OkHttp (network) — Plan to use for parallelizing a genetic algorithm.”
Conclusion and Moving Towards the State of Kotlin 2019
In the end, I’m confident that Kotlin will continue to grow in popularity, and eventually dominate the Android space — especially for new applications built in it. The biggest question out there is whether it will manage to spread out into other parts of development as successfully as it’s managed to spread into Android.
By this, I mean backend (where it’s actually seeing some uptick already), but also web via KotlinJS, and native compilation targets using Kotlin/Native, as well as what Kotlin for multi-platform support promises.
It will also be interesting to see how the tooling ecosystem consolidates in the coming months and years (if it does at all). What tools, libraries, and practices will become the standard, and which ones will sink into obscurity? We’ll learn that and more in the next edition of State of Kotlin.