A conference talk transcript by a Kotlin language evolution team member explaining why early returns are useful in Kotlin despite the language's expression-based style. The talk covers two key language features: smart casting (where the compiler refines types based on control flow, eliminating the need for manual casts after null checks or type checks) and inline functions (which allow lambdas passed to functions like forEach to use return statements that exit the outer function, making collection operations feel like native syntax). The speaker uses an alien contact domain model to illustrate how early returns interact with these features, and briefly discusses the trade-offs of marking your own functions as inline.
•15m watch time
Sort: