Kotlin is easily one of the best languages for developing apps. Written by JetBrains back in 2011 as a modern replacement for Java’s clunkier, more verbose syntax, Kotlin has rightfully become the preferred language for Android development. Part of its popularity is its versatility.
Most people write Kotlin to target Java platforms. However, it can be compiled into JavaScript or native code via LLVM to share business logic with non-Kotlin platforms. That versatility makes Kotlin somewhat unique, and its extension functions are a fantastic feature that showcases its power and flexibility.
These extension functions help you eliminate things like StringUtils.kt and other such files, seamlessly extending the language and molding it to whatever you need for your app. It’s time to learn more about how these work and how to use them to make your code cleaner, leaner, and easier to debug.
This lesson will cover the following points:
Define the purpose of extension functions.
Explain how to use this keyword.
Describe the extension properties.
See forum comments
This content was released on May 22 2024. The official support period is 6-months
from this date.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.