Conclusion

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

When used correctly, Kotlin extension functions can positively impact your project. They make your code significantly cleaner and ensure critical business logic, like regulatory logic, can remain in a central, easy-to-debug location. Just make sure that you don’t overuse them and that you understand the potential interoperability risks.

The key is to use these functions for your app’s critical business logic or utility functions that make no sense to exist in a separate class. For example, a function that takes a collection and grabs the third item or null if it doesn’t exist is a good case for Kotlin extension functions. Feel free to experiment and design, but know that Kotlin extension functions have the power to make your development easier.

See forum comments
Download course materials from Github
Previous: Demo Next: Quiz: Write Extensions