Demystifying Prototypal Inheritance in JS
While the latter ones use the
Interface Delegation in Kotlin
Interface Delegation is not a new thing. While it is easy to understand and implement this design pattern, this usually involves a lot of boiler plate code, and the huge changelog that comes with it in case of future alterations. Thankfully, Kotlin does provide a beautiful construct to implement this.
Suspension in Callbacks
Using suspend functions, we can make asynchronous code to look alike any another synchronous code.
But what if we can’t directly use suspend functions, and are instead dealing with the good-old callbacks?