Write idiomatic Kotlin with functions, lambdas and scope functions

8 steps · about 3 h 5 min · Intermediate

  1. Skim common Kotlin idioms (article, Kotlin docs, 20 min)

    A tour of patterns you should recognise in any codebase.

  2. Write functions with defaults and named arguments (article, Kotlin docs, 25 min)

    Covers the function syntax idiomatic Kotlin builds on.

  3. Speed up lambdas with inline functions (article, Kotlin docs, 25 min)

    Explains how higher-order functions avoid allocation cost.

  4. Choose the right scope function (article, Kotlin docs, 25 min)

    Compares let, run, with, apply and also.

  5. Transform collections (article, Kotlin docs, 25 min)

    Map, filter and fold in practice.

  6. Process lazily with sequences (article, Kotlin docs, 15 min)

    Shows when sequences beat lists.

  7. Follow the official coding conventions (article, Kotlin docs, 20 min)

    Makes your code look like everyone else's.

  8. Practise in the Kotlin playground (article, Kotlin by Example, 30 min)

    Runnable examples to edit.