Pebellslearn by building
RoadmapsMatrixCoursesSandboxSign in

Course details

Scala

Learn the core of Scala 3, the JVM language that blends object-oriented and functional programming. You will set up Scala, name values with the right types, combine them with operators, make decisions with if and match, store data in lists, sets and maps, and loop over it — all while building one small run club logbook.

Ready to learn6 sections · 24 lessons
Start learning

Course curriculum

Setting Up Scala4 lessons

Learn what kind of language Scala is, install it with Coursier, run a program with a @main function, try ideas in the REPL, and set up IntelliJ IDEA or a Metals-powered editor.

  1. What Scala Is and Why It Exists12 min
  2. Your First Program12 min
  3. The REPL: Answers in Seconds10 min
  4. Editors: IntelliJ IDEA and Metals10 min
Variables, Constants and Types5 lessons

Decide when a name may change with val and var, pick between whole numbers and decimals, build text with strings and interpolation, see where Unit and Nothing sit in the type hierarchy, and convert safely between types.

  1. val and var12 min
  2. Whole Numbers and Decimals12 min
  3. Strings, Chars and Booleans12 min
  4. Unit, Nothing and the Type Hierarchy14 min
  5. Converting Between Types12 min
Operators3 lessons

Use arithmetic operators and the / and % pair, compare values and combine conditions with short-circuit logic, and see why every Scala operator is really a method with a precedence set by its first character.

  1. Arithmetic Operators12 min
  2. Comparison and Logic12 min
  3. Operators Are Methods12 min
Conditionals3 lessons

Use if as an expression that returns a value, order else if chains so every branch is reachable, and choose by value with a first, simple match expression.

  1. if Is an Expression12 min
  2. else if Chains12 min
  3. match: Choosing by Value14 min
Data Structures5 lessons

Store runs in immutable Lists and Vectors, use Arrays where Java meets Scala, keep unique names in a Set, look distances up by name in a Map, and choose mutable collections on purpose when something must change in place.

  1. List and Seq14 min
  2. Vector and Array12 min
  3. Set: Each Value Once12 min
  4. Map: Looking Up by Key12 min
  5. Mutable Collections14 min
Loops4 lessons

Walk collections with for, count with ranges, repeat until a condition with while and leave early with boundary and break, then turn loops into values with for and yield.

  1. for Loops12 min
  2. Ranges: Counting Without a List12 min
  3. while Loops and Stopping Early14 min
  4. for with yield: Loops That Build14 min