Skip to main content

Posts

Showing posts from August, 2020

Functional and Idiomatic Kotlin

I've been programming in Kotlin for many months now, and there are a couple things I have noticed when working with others in a Kotlin-based project:  I greatly prefer Kotlin to Java.  Kotlin can quickly turn back into Java when people are not careful.  I do not claim to be a Kotlin expert. I do know that Kotlin was designed to be both more functional and idiomatic than Java out of the box. Because of this, I've decided to spend some time reviewing the Kotlin documentation again. Now that I have spent a good amount of time working in Kotlin, I think the documentation can help me become better about writing idiomatic Kotlin in particular. I've already spent enough time becoming familiar with functional programming; I am comfortable with mapping, various kinds of reducing, etc. Kotlin's scope functions , however, remind me that functional is not just about basic tools; it is also about expression, keeping code ever more DRY, and idioms that help other developers unde...