Facebook Engineering Blog
From zero to 10 million lines of Kotlin

From zero to 10 million lines of Kotlin

10/24/2022 · Omer Strulovich

What this post added

This post details Meta's large-scale migration of its Android codebase from Java to Kotlin, involving over 10 million lines of code. It outlines the technical motivations for adopting Kotlin, including its advantages in nullability, functional programming, and code conciseness. The post also discusses the challenges encountered, such as build time increases and interoperability issues, and describes the multi-step pipeline developed to automate the conversion process, including custom tooling like Ktfmt and postprocessing refactors. Examples of specific conversion challenges, like JUnit testing rules and the replacement of Java utility methods with Kotlin's standard library equivalents, are provided.

Read the original post ↗