Introduction

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

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
Download course materials from Github
Previous: Quiz: Define Generic Classes Next: Instruction