Refactoring to Expressive Kotlin | Dmitry Kandalov and Duncan McGregor

preview_player
Показать описание

Kotlin was built from the beginning as an expressive language, but we still scratch our heads when reading some code, especially if it is trying to do something complicated.

Join Duncan and Dmitry as they examine code examples and use the power of the Kotlin language and IntelliJ to refactor them into code that reads as it works. We’ll learn how to express intent with the scope functions: let, run, with, apply, and also. We’ll see how defining our own extension functions allows code to flow, and move on to more advanced topics like separating pure from impure functions, cohesion, tiny types and domain specific languages.

#kotlin #kotlinconf
Рекомендации по теме
Комментарии
Автор

That definitely was the most excruciating rename of a simple function that wasn’t even necessary in the first place.

three-alpha-six
Автор

You wasted my time a little bit 🤕 (Renaming)

emmanuelmtali
Автор

I always *beg* my fellow devs not to use also, apply, let (or other scope functions). They make the code a PITA to read.

lppedd