paint-brush
Using Kotlin Extension Functions: The Good, the Bad, and the Uglyby@aksenov
4,622 reads
4,622 reads

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

by Viacheslav Aksenov5mFebruary 12th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

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
Viacheslav Aksenov

Viacheslav Aksenov

@aksenov

I am a backend developer strongly experienced in Java / Kotlin, focused on Spring-based microservice-oriented systems.

About @aksenov
LEARN MORE ABOUT @AKSENOV'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Viacheslav Aksenov HackerNoon profile picture
Viacheslav Aksenov@aksenov
I am a backend developer strongly experienced in Java / Kotlin, focused on Spring-based microservice-oriented systems.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Newsbreak
Leftic
Moomoo
Sumi
Coffee-web
Allella