Developers love Kotlin
Since its humble start back in 2011, Kotlin’s popularity has suddenly skyrocketed.
From Google announcing Kotlin support in Android a year ago, to over 100k respondents of theStackOverflowsurvey voting it the second most loved language, JetBrains’ baby is thriving.
At Pusher, we wanted to learn what’s so special about Kotlin so we decided to dig deeper. We surveyed 2,744 people from January to March 2018 and took the pulse of the ecosystem.
Today, we’re proud to introduce you to the state of Kotlin✨
More than half of our respondents have been working as developers for less than 5 years.
They seem to have slightly less work experience than the people who took the StackOverflow survey. Yet, the trusted old math of "the developer population doubling every 5 years" still holds.
Years working as a developer
02. A success story in the making
Kotlin’s growth has been doubling each year until 2015, when the first massive spike in its usage happened.
Early that year, Jake Wharton released the document advocating Kotlin’s adoption at Square. They are known for creating some of the most popular open source libraries for Android.
As a result, a lot of people followed suit that year, giving talks and writing blog posts about Kotlin.
Adoption absolutely exploded after May 2017.
Google announced that Kotlin was officially supported for Android and a massive number of Android developers started using Kotlin.
This will likely boost Kotlin’s adoption for years to come. Check out the clip for the huge applause. 👏🎉
The official website is by far the most popular resource for learning Kotlin.
Students, however, tend to favor courses on YouTube and Udemy, as well as various conference talks and demos.
These websites will likely be joined by streaming and live coding services such as Twitch in the next few years. 🎥
04. Everyone has their favorites
Null safety is a favorite feature for everyone who ever had a NullPointerException in Java - i.e. every Android developer 😂.
4% of diehard Star Wars fans selected “First Order Functions” from the questionnaire — a little “easter egg” that slipped in when The Last Jedi was playing in theatres…
Extension functions are used across the board.
As confirmed by 77% of respondents, extension functions tend to make code more readable, especially when used in a functional programming context or when creating DSLs. The more experienced the respondent, the more likely they are to use them.
Extension functions use cases
Besides extending Java classes with Kotlin, people often migrate existing Java code to Kotlin.
Over 87% of respondents have done migrations. Both using a wizard or rewriting code manually are popular techniques.
Out of the 10% of brave souls who migrated entire projects using the wizard, 22% of them were students or had less than one year experience working as software developers.
Migrating Java to Kotlin
Over a quarter of respondents who migrated Java to Kotlin needed to revert.
Reasons for reverting are both technical and organizational. Tools that use reflection or generate code have been most often mentioned as technical reasons to revert to Java.
Reasons for returning to Java
Cross-platform Kotlin is picking up, but slowly.
Only about a quarter of respondents mentioned they used any type of cross-platform support, with most opting for Kotlin/Native, followed by KotlinJS.
Once these features have been out for some time, the adoption will most likely start to pick up. Then, Kotlin might have a fighting chance at becoming the true write once, run anywhere language.
Coroutines are the new official async way do Kotlin. to
Coroutines are labeled experimental, which is why they are rarely used.
They are being used by less than a third of respondents, all which have more than 5 years of experience of working in tech. It’s likely that they have used coroutines with other languages, which is why they feel comfortable using it with Kotlin.
Reasons to use coroutines (or not)
Similar to coroutines, DSLs aren’t being widely used yet, as they are seen as a more advanced topic.
About 40% of respondents have used a DSL, and out of those people, a quarter developed DSLs themselves
When asked what kind of DSLs they built, over half of the respondents answered highly specific DSLs - for finance, big data, and other fields. Other often mentioned DSLs include helpers specific to Android, and configuration tools.
Most popular DSLs
#Kotlin2019 and beyond
Kotlin's rapid growth is nothing short of exciting. But can it fulfill all its promises?
Given all the support by both JetBrains and Google, and the almost universal love that Kotlin receives in the developer community, we are sure that the language is not going anywhere. The main question is: will it manage to seriously break into the communities outside of Android?
JetBrains is heavily pushing the multi-platform dream, but will it see sufficient adoption in the following months and years? Will Kotlin become the new standard for web, iOS, or backend developers?
Regardless of this, even if it takes years to expand beyond the world of Android, we’ll still see new generations of developers taking their first steps into programming with Kotlin. They will have a modern, versatile, cross-platform language at their disposal. One that can cross between OO, functional, scripting, and declarative paradigms with ease.
This could mean that Kotlin will affect the wider programming language landscape by becoming a benchmark for what a programming language should be able to do.
One thing is for sure: there are exciting times ahead for the Kotlin ecosystem.
What are your opinions or thoughts? Either on the future of Kotlin itself, or this survey? Either drop us an email email@example.com, or use the #StateOfKotlin hashtag on Twitter.
Want to shape the next state of Kotlin?
Leave us your email and we'll be in touch when we're running it again*.*No spam, we promise. Not just because of GDPR, but because we're actually good people.