Context of the research and research questions #
Fragments conducted an online survey with Android developers and teams about Kotlin adoption between March and April 2021. The survey aimed at answering two questions:
- The extent of Kotlin adoption in the Indian startup and enterprise ecosystem.
- How organizations are leveraging Kotlin and its features beyond UI development i.e., whether Kotlin is used for backend engineering and building data pipelines.
Key findings #
Survey respondents were primarily drawn from Android engineers and Android teams in startups, mid-sized organizations and enterprises.
Survey results show that:
Kotlin’s adoption will increase in 2-3 years, with the likelihood that the next generation of entrants in Android software development will be Kotlin native. This will displace Java’s dominance as a programming language for building Android apps.
The results also reinforce that Kotlin is primarily used for UI development. The language’s features and ability for backend engineering is still under-utilized, at least among developers and teams who mainly build Android apps (since the survey respondents are from this demographic).
More importantly, the survey reveals that engineering managers are concerned about moving large Java codebases to Kotlin because of the concern that they will not be able to hire Kotlin programmers and ramp up their teams.
Scroll down to read about the survey sample and detailed findings, and to see the survey questionnarie. #
Conclusions and recommendations #
Despite the growing demand for Kotlin and the backing of big tech firms such as Google/Android, there still exist skill gaps in the adoption of Kotlin in India. Kotlin has far-fetched benefits beyond Android as well mainly,
- On the server side, with their interoperability with the Java ecosystem.
- A cross platform mobile and web application development platform through their Kotlin multi platform.
Organizations appear to be reticent in moving their codebase to Kotlin, especially when the codebases are large. This slow move is compounded by the apprehension that hiring Kotlin programmers will be difficult and that upskilling entire teams will be difficult. The current skill gaps likely exist because most developers depend on learning the language by themselves, without access to formal training, and without community forums where experiential case studies about Kotlin can be shared freely.
We conclude that for organizations to make better progress towards adoption of Kotlin, they have to invest in training and upskilling their employees because Kotlin will be the future for Android development.
Survey design and data analysis: #
Bhavani Seetharaman is Research Associate at Hasgeek.
Zainab Bawa is co-founder, director and Chief Operating Officer (COO) at Hasgeek.
Bhavani Seetharaman and Zainab Bawa have written this report. Madhusudhan Sambojhu actively reviewed the report and helped in nuancing the findings and conclusions.
Support team: #
Anish TP illustrated the report.
Review and feedback: #
We would like to thank:
Key findings of the survey
Based on the historical context of Kotlin’s growth in the Android ecosystem, the survey’s findings reinforce that many users of Kotlin also have a Java background.
Experience levels and comfort working with Kotlin #
Despite being a much younger language, Kotlin is the second most popular language that developers are comfortable working with. The survey results also show that most developers have only recently begun working with Kotlin, with a majority of the respondents stating that they have been working with Kotlin for 1-3 years.
Style of writing Kotlin code #
The data also shows that almost 68 percent of respondents write Kotlin using idiomatic Kotlin code, while 32 percent of the respondents still continue to use Java style of writing code.
Bangalore-based design firm, Obvious Ventures Private Limited, identified this gap in Kotlin adoption i.e., that individuals use Java style of writing code despite moving to Kotlin. This slows down the transition that teams can make to Kotlin. Between February and March 2021, Obvious conducted workshops for mid-career Android programmers and teams on how to write code in Kotlin efficiently.
Ease of working with Kotlin #
When asked why their organizations chose Kotlin as a choice of language for building apps, participants indicated faster compile times and less verbosity of code as the key advantages of Kotlin. One of the survey respondents said:
“Kotlin is chosen as the framework for Android app development in my organization mainly due to ease of coding, elimination of null references, and excellent interoperability with Java.”
Yet another respondent highlighted the sentiment that developers use Kotlin because of the features it has to offer.
“Kotlin is much more succinct and fun to use compared to Java. We can achieve more with less boilerplate. It has so many cool features, like nullability checks, stateflows and coroutines without which it wouldn’t be as easy to develop.”
Related to the above, the survey shows that 34 percent of respondents’ organizations have 80-100 percent of their codebase in Kotlin, while 33 percent of the respondents’ organizations have between 0-20 percent of their codebase in Kotlin.
The response below summarizes why developers prefer Kotlin over Java:
“Reduced boilerplate code, improved app stability, better tooling support, better null safety. Overall, increased developer happiness.”
Percentage of codebase migrated to Kotlin in organizations #
We also see that approximately 32 percent of respondents had only 0-20 percent of their codebase in Kotlin, indicating that a significant proportion of the industry has still not adopted the language. When probed further, respondents indicated that their organizations were resisting the move towards Kotlin. This was the case for 22 percent of the respondents.
Key challenges in working with Kotlin #
When asked to describe the major challenges that teams/organizations face in migrating their codebase to Kotlin, the following were identified as key issues:
- Null safety and handling nullable objects.
- Not enough documentation is available; lack of library support.
- Novelty of functional programming for teams that aren’t used to writing code in this paradigm.
- Hiring and onboarding developers to ramp up to Kotlin; apprehension among managers whether they’d be able to hire Kotlin programmers.
- Syntax confusion for Java developers who now have to work with Kotlin.
- Large codebase, and lack of bandwidth to migrate. One respondent specifically pointed out:
“We’re a B2B company. We cannot introduce Kotlin in our SDKs as they will require shipping the Kotlin standard library dependency with the SDK. This can be problematic for apps still using Java as it will increase the SDK size at compile time.”
Leveraging Kotlin beyond UI development #
This survey results show three key findings in this regard:
- Developers rarely utilize new tooling in Kotlin such as Jetpack Compose.
- The primary comfort of developers is to use Kotlin for UI development. We read this as a bias among the survey respondents who may primarily be UI developers, and who therefore don’t use Kotlin for backend development purposes.
- Only 33 percent of the respondents use Kotlin for building data pipelines, again indicating lack of diversity in the roles of survey respondents i.e., the survey has most responses from UI developers rather than from backend developers working with Kotlin.