Using Kotlin Extension Functions: The Good, the Bad, and the Uglyby@aksenov
2,418 reads

Using Kotlin Extension Functions: The Good, the Bad, and the Ugly

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

Extension functions in Kotlin allow you to natively implement the "decorator" pattern. They let you write new functions for a class from a third-party library that you can't modify. Such functions can be called in the usual way as if they were methods of the original class. Let's see how complex they can get and how to use them the right way.

People Mentioned

Mention Thumbnail
featured image - Using Kotlin Extension Functions: The Good, the Bad, and the Ugly
Viacheslav Aksenov HackerNoon profile picture

@aksenov

Viacheslav Aksenov


Receive Stories from @aksenov

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa