Coping with Kotlin’s Scope Functions: let, run, also, apply, with

Coping with Kotlin’s Scope Functions: let, run, also, apply, with

Functional Programming, Kotlin, Software Development
Kotlin Scope Functions Functions in Kotlin are very important and it's much fun() to use them. One special collection of relevant functions can be described as "Kotlin Scope Functions" and they are part of the Kotlin standard library: let, run, also, apply and with. You probably already heard about them and it's also likely that you even used some of them yet. Most people tend to have problems distinguishing all those functions, which is not very remarkable in view of the fact that their names may be a bit confusing. This post intends to demonstrate the differences between the available scope functions and also wants to discuss relevant use cases. Finally, an example will show how to apply scope functions and how they help to structure Kotlin code in a…
Read More