
The first few of these assemblies were dedicated to introductory Kotlin presentations based on sources such as the official language guide, Kotlin Koans, the official Android docs, and the MindOrks cheat sheet.Įach Android developer was then assigned some Java code to port to Kotlin. Getting developers up to speedĪll Android developers at Duolingo meet biweekly for discussion of recent and upcoming platform changes, informal postmortems, and Q&A. Ultimately our Android developers decided unanimously that the benefits were valuable enough to justify a policy of writing all new Android code in Kotlin, although we weren’t yet ready to commit further to a total migration of all existing code. Another concern was that Kotlin, like CoffeeScript, might eventually be made obsolete by backported improvements to the very language it set out to improve. There were some risks too, primarily that a Kotlin migration might not be worth its opportunity cost in developer time. Our own developers had already reacted positively to similar language upgrades on our two other major platforms: support for Swift in our iOS app and our complete rewrite of in TypeScript. Kotlin was among Stack Overflow users’ most loved languages of 2018, second only to Rust. Kotlin’s null safety features prevent more NPEs from reaching users and allow us to focus on other problems during code review since there’s so much less boilerplate to sift through. Our Android repo’s history contains over 100 commits from its Java days along the lines of “Fix NullPointerException crash”.

Its seamless interoperability with Java and conservative approach to adding new language features make it a breeze for any Android developer to pick up. Kotlin is far less verbose than Java, making it faster and easier to both write and (more importantly!) maintain.

It wasn’t yet clear that Kotlin would ever reach its current level of popularity or go on to unseat Java as Google’s preferred language for Android development. When we first started considering Kotlin in early 2018, Android support for it was less than a year old. Lines of code in Java (red) and Kotlin (green) over time Why Kotlin There are already plenty of resources online for learning Kotlin, so in this post we’ll focus on our own experience of deploying Kotlin code to millions of users. Two years later, it’s now 100% Kotlin! This migration proved to be a huge success for us in terms of developer productivity and happiness.

Duolingo for Android was a Java app for its first five years of existence.
