Scala 3 first steps with functional style

8 steps · about 3 h 30 min · Beginner

  1. Compile and run a Scala 3 program (tutorial, Scala Documentation, 15 min)

    Get a working toolchain and see the minimal program structure first.

  2. Prefer val over var (tutorial, Scala Documentation, 20 min)

    Immutability by default is the habit that makes Scala code easy to reason about.

  3. Use if, for and match as expressions (tutorial, Scala Documentation, 25 min)

    In Scala control structures return values, which changes how you write logic.

  4. Define methods with clear signatures (tutorial, Scala Documentation, 20 min)

    Method syntax, default parameters and extension methods come up in every file.

  5. Model data with case classes and enums (guide, Scala Documentation, 40 min)

    Case classes and enums let the compiler check every shape your data can take.

  6. Write anonymous functions (guide, Scala Documentation, 20 min)

    Short lambdas are the input to every collection method you will use next.

  7. Transform collections with map, filter and fold (guide, Scala Documentation, 40 min)

    Chaining collection methods replaces most loops and is idiomatic Scala.

  8. Handle errors with Option and Either (guide, Scala Documentation, 30 min)

    Returning failures as values keeps functions pure and composable.