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.

TopicContentKey keywords
Basic SyntaxVariables, constants, basic typesval, var, type inference
Control StructuresConditionals, loopsif, for, while, match
Functions and MethodsFunction definition, lambdadef, =>, default values
Classes and ObjectsOOP basicsclass, object, trait
Case ClassesImmutable data modelscase class, copy
Pattern MatchingPowerful branchingmatch, 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.

TopicContentKey keywords
CollectionsData structuresList, Map, Set, Seq
Higher-Order FunctionsFunctional programmingmap, filter, fold
GenericsType parameters[T], type bounds
For ComprehensionMonadic operationsfor-yield, flatMap
Implicit/GivenContextual abstractionimplicit, 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.

TopicContentKey keywords
Type ClassesAd-hoc polymorphismType class pattern
VarianceGeneric type variance+T, -T, invariance
Advanced TypesScala 3 type featuresUnion, Intersection, Match Types
MacrosCompile-time code generationinline, macros
ConcurrencyAsynchronous programmingFuture, Promise
Functional PatternsFP design patternsFunctor, 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 Objects

If 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 Patterns

If 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 → Macros

Scala 2 vs Scala 3 comparison#

All documents in this guide cover both versions. The table below summarizes the main differences.

FeatureScala 2Scala 3
Syntax styleBraces requiredIndentation option
Implicit valuesimplicit valgiven
Implicit parametersimplicitusing
Enumssealed trait + case objectenum
Extension methodsimplicit classextension
Type featuresLimitedUnion, Intersection, Match Types

Each document uses Scala 2 Scala 3 badges to indicate version-specific differences.