In some cases, especially when working with an API with a provided Java SDK, we often find ourselves in creating a (very) deeply nested Java object using setters. Creating Java object with a lot of setters is annoying and error-prone. Kotlin scope function can help to make our code much more readable in these cases.

#kotlin #code-readability

Using Kotlin scope functions to create deeply-nested Java objects easily
1.25 GEEK