As of 2021, Kotlin is now a typically out there language throughout all of Google. The corporate first introduced in 2019 that it was taking a Kotlin-first method in Android, however since then it has expanded its assist and applied Kotlin in additional than 60 purposes equivalent to Google House, Drive, Maps, Pay, Sheets, and Docs.
“What we have now actually seen is that our builders adore it, and we’ve seen a ton of progress simply when it comes to utilization each inside and outside Google,” mentioned Karen Ng, product lead for Kotlin and Android growth instruments.
Ng defined the adoption occurred organically throughout the firm. Earlier than Google determined to undertake it, the Android neighborhood wrote an open letter to the corporate about Kotlin and its advantages.
After adopting it, Google discovered it was simply simpler, safer and extra dependable to work with than different languages. As an example, it’s totally interoperable with Java, making it simpler for builders and Google to undertake it with out having to rewrite a bunch of code, in keeping with Ng.
RELATED CONTENT: The rise of Kotlin
Kotlin additionally supplies safer code by having the ability to take nullable and non-nullable data into the kind system and assist builders keep away from complete crashes, Ng defined. Google House was capable of scale back crashes by greater than 30% with the assistance of Kotlin.
“The Google House workforce determined to include Kotlin into their codebase to make programming extra productive and to allow the utilization of recent language options like var/val, good casts, coroutines, and extra,” the corporate revealed in a case research. “As a result of Kotlin could make nullability part of the language, tough conditions may be prevented, like when inconsistent utilization of nullability annotations in Java would possibly result in a missed bug. For the reason that workforce began migrating to creating new options with Kotlin, they noticed a 33% lower in NullPointerExceptions. Since that is the commonest crash kind on Google Play Console, decreasing them led to a dramatically improved person expertise.”
Different options like coroutines had been particularly essential for Google to have the ability to assist cell apps deal with asynchronous information.