Vocabulary Word
Scenario:
This code would be much cleaner if we could just add a function to this existing class. It's a hassle to create subclasses for such small features.
Response:
Could we use Kotlin extension functions here? They allow us to add functions to the original class without changing it.
Scenario:
Android's TextView class doesn't provide us with the flexibility we need for this UI design. It would make things a lot easier if we could add functions on the fly.
Response:
We could apply Kotlin extension functions to add the needed functionality to the TextView class.