Write idiomatic Kotlin with functions, lambdas and scope functions
8 steps · about 3 h 5 min · Intermediate
- Skim common Kotlin idioms (article, Kotlin docs, 20 min)
A tour of patterns you should recognise in any codebase.
- Write functions with defaults and named arguments (article, Kotlin docs, 25 min)
Covers the function syntax idiomatic Kotlin builds on.
- Speed up lambdas with inline functions (article, Kotlin docs, 25 min)
Explains how higher-order functions avoid allocation cost.
- Choose the right scope function (article, Kotlin docs, 25 min)
Compares let, run, with, apply and also.
- Transform collections (article, Kotlin docs, 25 min)
Map, filter and fold in practice.
- Process lazily with sequences (article, Kotlin docs, 15 min)
Shows when sequences beat lists.
- Follow the official coding conventions (article, Kotlin docs, 20 min)
Makes your code look like everyone else's.
- Practise in the Kotlin playground (article, Kotlin by Example, 30 min)
Runnable examples to edit.