Learn Scala’s core concepts systematically. From basics to advanced, each concept covers both Scala 2 and Scala 3 syntax. Progressing in an appropriate order based on your level and goals is effective.
Basics#
Learn the fundamental building blocks of programming in Scala. From variable declaration to pattern matching, these are the concepts that form the foundation of Scala programming.
| Topic | Content | Key keywords |
|---|---|---|
| Basic Syntax | Variables, constants, basic types | val, var, type inference |
| Control Structures | Conditionals, loops | if, for, while, match |
| Functions and Methods | Function definition, lambda | def, =>, default values |
| Classes and Objects | OOP basics | class, object, trait |
| Case Classes | Immutable data models | case class, copy |
| Pattern Matching | Powerful branching | match, case, guards |
It’s best to learn basic concepts in order. In particular, understanding variable declaration and the type system first will make subsequent concepts easier to learn.
Intermediate#
Learn functional programming and Scala’s characteristic features. Mastering the Collections API enables you to express most data processing tasks concisely.
| Topic | Content | Key keywords |
|---|---|---|
| Collections | Data structures | List, Map, Set, Seq |
| Higher-Order Functions | Functional programming | map, filter, fold |
| Generics | Type parameters | [T], type bounds |
| For Comprehension | Monadic operations | for-yield, flatMap |
| Implicit/Given | Contextual abstraction | implicit, given, using |
Intermediate topics are crucial for building Scala’s functional programming capabilities. Master collections and higher-order functions first, then build on them with For Comprehension and Implicit.
Advanced#
Advanced topics for professional Scala development. Covers advanced features of the type system, concurrent programming, and functional design patterns.
| Topic | Content | Key keywords |
|---|---|---|
| Type Classes | Ad-hoc polymorphism | Type class pattern |
| Variance | Generic type variance | +T, -T, invariance |
| Advanced Types | Scala 3 type features | Union, Intersection, Match Types |
| Macros | Compile-time code generation | inline, macros |
| Concurrency | Asynchronous programming | Future, Promise |
| Functional Patterns | FP design patterns | Functor, Monad |
It’s best to study advanced topics after fully understanding intermediate level content. In particular, type classes are essential for understanding and extending libraries.
Learning guide#
We recommend different paths depending on your learning goals.
If you’re starting out
Start with basic syntax and proceed in order through control structures, functions and methods, and classes and objects. Building a solid foundation is important. In particular, understand the difference between val and var, and expression-based syntax.
Basic Syntax → Control Structures → Functions and Methods → Classes and ObjectsIf you want to learn functional programming
Start with collections and proceed through higher-order functions, For Comprehension, and functional patterns. Mastering Scala’s Collections API will naturally develop functional thinking.
Collections → Higher-Order Functions → For Comprehension → Functional PatternsIf you’re transitioning to Scala 3
Start with Implicit/Given and proceed through advanced types and macros. The biggest change in Scala 3 is the implicit system. Learn the given/using syntax first.
Implicit/Given → Advanced Types → MacrosScala 2 vs Scala 3 comparison#
All documents in this guide cover both versions. The table below summarizes the main differences.
| Feature | Scala 2 | Scala 3 |
|---|---|---|
| Syntax style | Braces required | Indentation option |
| Implicit values | implicit val | given |
| Implicit parameters | implicit | using |
| Enums | sealed trait + case object | enum |
| Extension methods | implicit class | extension |
| Type features | Limited | Union, Intersection, Match Types |
Each document uses Scala 2 Scala 3 badges to indicate version-specific differences.