What We've Learned at KotlinConf 2018
Article Summary
Rares Musina from N26 shares how their mobile bank went all-in on Kotlin—and what they learned at KotlinConf 2018. Spoiler: coroutines, DSLs, and faster backends are changing everything.
N26's engineering team attended KotlinConf 2018 in Amsterdam and documented their transition from Java to Kotlin across both Android and backend services. The article covers major announcements including Kotlin 1.3, coroutines going stable, and emerging patterns in the Kotlin ecosystem.
Key Takeaways
- N26's Android codebase reached nearly 50% Kotlin in production, all new code written in Kotlin
- Coroutines enable async code with synchronous structure, cutting execution time from 2017ms to 1017ms
- DSLs replacing XML configs in frameworks like Gradle, Ktor, and Spring Boot
- Backend frameworks compared: Spring Boot most mature, http4k and Ktor show promise for faster boot times
- Kotlin/Native introduces Workers model inspired by Actors for safer concurrent programming
N26 successfully transitioned to Kotlin through grassroots experimentation during hack days, proving production viability before company-wide adoption, with coroutines and DSLs emerging as the language's killer features.
About This Article
N26's backend engineers struggled with callback hell and complex error handling when dealing with asynchronous I/O operations. Their non-blocking code was hard to structure and maintain.
They switched to Kotlin 1.3's coroutines, which let them write asynchronous code that looks and reads like synchronous code. This eliminated nested callbacks and made exception handling much simpler.
Concurrent operations that took 2017ms now run in 1017ms, a 50% improvement. The code stayed readable and easy to follow, without sacrificing performance.