
Explore the basics of Scala 3 by getting started with SBT and the REPL, using Visual Studio Code worksheets, and writing simple conditionals and loops.
Explore the scala repl, sbt, and basic variables, types, functions, conditionals, try-catch, and loops, then run worksheets using visual studio code and complete exercises and tests.
Explore the Scala repl, its command-line usage, and type inference, learn to load scripts, quit, and inspect expression types with colon help.
Run scala from the sbt build tool and access the repl via the sbt console, switching versions by updating build.sbt.
Learn how to exit the Scala 3 REPL, understand read-evaluate-print loop behavior, complete versus incomplete expressions, and use indentation to signal multi-line, significant whitespace.
Learn how vals in Scala are immutable names assigned to values, unlike vars which can change; understand type safety and why functional style favors vals.
Explore how the Scala REPL can hide an old val by redefining a new one in a new scope, revealing how scope controls visibility without reassignment.
Explore Scala repl by creating brace-enclosed blocks, shadowing outer values, and watching inner scopes hide and reveal outer ones when closed.
Explain how Scala assigns a type to every variable, and how var x = 10 becomes an integer that cannot become a double. Show explicit typing versus type inference.
Learn how to define methods with def in Scala, require parameter types, and optionally a return type. Use an add example to show parameter type inference limits.
Demonstrate how if expressions return values in Scala 3, compare them to statements in other languages, and learn the new, cleaner syntax using then and optional parentheses.
See how Scala treats if as an expression, highlighting hybrid functional style and avoiding side effects and vars. Understand that the last expression yields the value, with return discouraged.
Learn how Scala uses try, catch, and finally as expressions to handle exceptions, return values, and always run finally for side effects such as closing files.
Explore Scala 3 exception handling with try, catch, and finally, including arithmetic exceptions, and learn the single true looping construct while do, plus string interpolation and the unit type.
Examine the do while concept versus a while loop, and show how Scala can simulate do while by placing the body in the while block, with unit representing doing nothing.
Explore using worksheets in VS Code to run interactive Scala scripts, replacing the REPL, with instant results, live errors, and features like hover docs and hotlinking.
Run the first Scala exercises by loading scripts in VS Code and compiling with SBT; then build a timetable worksheet with nested while loops to produce a 25-line times table.
Take the next steps with Scala, deepen knowledge of language constructs, use worksheets, and learn to run tests in VS Code for the module two exercises.
Explore quick Scala basics in VS Code, recap method parameters and return types, compare expressions and statements, and preview tuples, rewriting rules, collections, extension methods, and functional versus imperative styles.
Set up visual studio code with the metals extension, import the exercises directory, and verify indexing completes, then run the Cohen's tests and try the exercises before viewing solutions.
Open, run, and pin worksheets in VS Code for Scala with real-time evaluation and visible outputs. Create new worksheets, edit, save, and instantly see updated results.
Explore Scala's strict static type system and type inference, showing how public methods declare return types, while single-line expressions infer types; parameters must have explicit types, unlike Haskell.
Scala enforces a return type for every method, using unit as the void-like singleton to indicate a side effect. Scala 3 eliminates procedure syntax and requires equals in method definitions.
Scala 3 introduces a cleaner syntax with significant whitespace and less curly braces, while clarifying expressions versus statements and the for yield versus for do constructs.
Explore the difference between statements and expressions in Scala 3, examining val and var, return types, and how assignments can yield unit with side effects.
Explore Scala tuples as a lightweight way to group data without needing to define a new class, and learn to return and access (sum, difference) using _1 and _2.
Unpack tuples in Scala 3 with named vals, explore arity beyond 22 and nested tuples, and avoid runtime errors by preferring case classes for very large arity.
Explore Scala 3 rewriting rules, where symbols as method names enable infix syntax, expressions desugar to simple method calls, and Scala avoids operator overloading, with rewriting occurring only when necessary.
Explore Scala's rewriting rules that simplify syntax by translating array and list creations into apply method calls, reducing boilerplate and improving readability.
Explore mutability by updating a mutable array element, such as setting the second index to ten. The operation rewrites to an update call.
Review how Scala 3 rewriting tools activate only when code won't typecheck, and note rewrites won't apply if code compiles as is, especially when apply or update methods are absent.
Explore Scala collections through the array and list examples, learn how type parameters define collection element types, and differentiate mutable arrays from immutable lists, using type inference and explicit annotations.
Explore scala's list initialization, including immutable lists, right-associative cons syntax, and efficient head-first construction; learn to concatenate with triple colon and handle type inference pitfalls.
Explore Scala sequences by comparing lists, arrays, and vectors, subtypes of the seek trait, with emphasis on mutable vs immutable behavior and implicit conversions.
Contrast sets with sequences by showing that sets are unordered and unique, with duplicates removed, while sequences preserve order and are homogeneous.
Explore mutability and immutability in Scala collections. See how arrays can grow, while lists and vectors remain immutable, and how plus equals rewrites affect mutable vs immutable sets.
Learn about maps in Scala as mutable and immutable key-value stores, updated with plus equals, and created with tuple twos and arrow syntax for concise key-value pairs.
Explore how the Scala 3 right arrow acts as a symbolic extension method, rewritten by implicits into a tuple from two items, enabling natural infix syntax without extra keywords.
Iterate a map with a for expression, unpack tuple twos, and print step and instruction. Map order isn't guaranteed; use a sequence to preserve order and avoid list map.
Compare mutability with functional style, avoid side effects, favor expressions, vals over vars, and immutable data structures. Keep methods short, avoid leaking mutability in APIs, and defer optimization to JVM.
Learn how to open and read a file in Scala using Source.fromFile and getLines, with caveats about production use and side effects, preparing for the module’s exercises.
Run module two exercises by executing Scala tests, fix failing cases, and fill in blanks to make tests pass. Learn array handling and test-driven practice with the module two solutions.
Explore Scala 3 core concepts in module three, including classes, objects, and applications, and understand how these elements enable building applications.
Explore the definition of classes and objects in Scala, with construction fields and parameters. Learn auxiliary constructors, companion objects, factory methods, private constructors, and implicit conversions.
Explore the old Scala 2 class syntax and the new Scala 3 colon-based, indentation-driven form. See how constructors run and how vals and defs define members.
Explore the Scala primary constructor, which runs when creating a new instance, and understand private this parameter scoping, public access via def, and the factory pattern as the idiomatic approach.
Learn how Scala treats constructor parameters as private by default, how vals and defs default to public, and how adding a val makes a parametric field with automatic accessors.
Create a rational class to represent fractions with a numerator and denominator as a value class. Instantiate, access n and d, and override toString and equals and hashCode.
Enforce zero denominator in a rational class with a require predicate, throwing an illegal argument exception, and illustrate min and add operations.
Apply the min method to compare two rational numbers and return the lower. Reference the current instance with this, and compare old versus new syntax.
Explore Scala 3 infix rules and symbolic method names to write readable operations, such as plus for rationals, while noting this isn’t operator overloading and emphasizing meaningful naming.
Migrating the add method to a symbolic plus shows that plus is interchangeable with add and can be used in standard method-call style.
Learn how to add an integer to a rational in Scala 3 using an auxiliary constructor, treating integers as rationals with denominator one, and calling the primary constructor.
Explore how Scala companion objects provide a singleton companion to a class, enabling private access and apply-based factory methods, including parsing strings into rationals.
Make the primary constructor private inside the companion object to restrict external access. Rely on factory methods to initialize instances, enabling richer representations and avoiding direct new calls.
Learn to overload plus to add an int to a rational in Scala 3, promoting int to a rational and enabling five plus a half and a half plus five.
Learn how implicits in Scala implicitly convert an Int to a rational via an apply method, enabling rational addition with minimal boilerplate.
Explore how implicits extend the Scala type system with obvious, safe conversions. Avoid overuse that leads to magical, hard to debug behavior; note companion objects and the implicit keyword.
Learn how companion objects share a source file with a class or trait. Explore standalone objects as main entry points; Scala 3 top level values and methods with @main.
Explore Scala 3 main methods, args handling with var args, and running and configuring them in VS Code, then tackle module 3 exercises by implementing a complex number class.
Explore control structures in Scala 3, recap the ones we've covered, look at those we haven't yet, and revisit statements versus expressions.
Review expressions versus statements and Scala's unit, recap val and var, and examine try catch finally and while loops, then demystify for expressions, match expressions, guards, and string interpolation.
Compare expressions and statements in Scala: expressions return values, while statements yield unit with side effects avoided in functional programming; learn to use println and IO without compromising purity.
The unit type requires a side effect for usefulness, since unit provides no return. Non unit types have side effects, and unit is a value type close to primitive types.
Learn how and why you might return a value other than unit to enable fluent method chaining in a file writer example, while preserving side effects.
Return this or that type to enable fluent style method chaining in Scala 3, demonstrating how return patterns support readable, chained code.
Learn how Scala's if expression acts as a value-producing construct, unlike Java's statement-only if. See a file name example where if yields the file name.
prefer val over var to keep code easier to reason about, since val is immutable and var is mutable; use hints to minimize var usage and favor expressions over statements.
Explore how scala 3 treats try, catch, and finally as expressions for exception handling, returning values via try and catch while finally performs side effects like closing files.
Compare Scala 2 and Scala 3 while loop forms, showing side effects and termination. Adopt a tail-recursive style with tail call optimization and final for printing hello five times.
Explore the Scala 3 for expression, including for do style and unit results, and how ranges like 1 to 10 are transformed by for each.
Master the for yield construct in Scala 3, turning loops into a functional expression that returns a sequence, using map and flatMap via generators to flatten results.
Explore the Scala 3 for expression, its four Gs (generator, guards, lines, yield), including inline val assignments, and how it translates to filter, flatMap, and map.
See how for expressions rewrite to map, flatMap, and filter, enabling operations on values in any container. Learn asynchronous, non-blocking programming with futures and timeouts for results.
Explore Scala's match expressions, an expression form like Java switch, with no fall through, new Scala 3 syntax, and default handling using underscore, returning values or performing side effects.
Apply guards in Scala 3 match expressions to test zero, negative, and positive values, placing guards before the rocket and using V on the right side.
Master Scala 3 pattern matching across any type, with list patterns, nil, and concrete cases, and learn to avoid runtime match errors by providing a default case.
Master string interpolation in Scala 3, using s and f forms for variable substitution and printf-style formatting. Discover floating point limits, padding and precision, raw strings, and triple-quoted multi-line strings.
Fix the failing tests in module four by working through the exercises, run individual tests with the go button, and prepare to move on to module five.
Master functional programming in Scala 3 by treating functions as first-class citizens, embracing immutability, and using closures in module five.
Explore how private and nested methods give way to function literals, higher-order and first-order functions, and concepts like placeholder syntax, partial application, closures, and partial functions in Scala.
Illustrates using a private tail-recursive helper inside an object to compute factorials, with the tailrec annotation guaranteeing tail call optimization and a public method returning the first ten longs.
Learn how nested methods in Scala 3 tidy code by moving logic inside another method, making the inner method inherently private and inaccessible outside its parent scope.
Learn how nested method scoping lets inner methods access outer parameters like n, eliminating extra arguments, and simplify recursion with an accumulator to control factorials.
Explore anonymous function literals in Scala 3 by using map to apply a function across a list, and see how a nameless function can be created and used with val.
Decode how function literals trigger a rewrite to an apply call: creating a function instance with an apply method, invoked when you pass parameters, with Java eight lambdas boosting efficiency.
Explore how function arity works in Scala 3, including arity two or more, type signatures like int to int, and the currying and tupled forms.
Explore higher order functions in scala 3, distinguishing first order from higher order, with map, flatMap, and predicates shaping collections and futures.
Write a higher order function in Scala that uses sliding(2) on a list of int and applies an arity-two comparator to each neighbor pair.
Explore placeholder syntax in Scala 3, using function literals and anonymous functions to define operations, with examples of addition and absolute value, and when to fall back to full form.
Explicitly type the placeholder syntax when scala cannot infer types, using type annotations to define placeholders for variables like A and B as int.
Explore partial application of functions in Scala 3 by learning how to leave parameters unfilled, use placeholder syntax, and distinguish functions from methods through currying and fully applied examples.
Explore partially applying all or part of a function in Scala 3, using underscores and eta expansion to turn methods into functions and apply them symmetrically.
Explore closures in Scala: distinguish closures from function literals, understand how closures capture surrounding state and can cause side effects, and why referential transparency breaks when vars are closed over.
Explore the difference between partial application and partial functions in Scala 3, with guards and pattern matching defining inputs like x > 0 only, using significant whitespace syntax.
Explore partial functions in Scala 3, learn how isDefinedAt verifies inputs, and avoid match errors when applying operations like square root.
Explore how partial functions drive collect in Scala, filtering undefined values and mapping defined ones to evens. See how match and catch use partial functions for exceptions you care about.
Explore var args in Scala to handle any number of arguments without writing many apply methods, and see how a function can accept parameters to build a list.
Explore Scala varargs by defining a make list that accepts a variable number of integers and converts the input array to a list.
Explore how to call var args with a sequence in Scala using the expansion (splat) operator to convert a collection into individual arguments, including recursive calls.
Master named and default parameters in Scala 3, using parameter names to call methods clearly, reorder arguments, and override defaults for better readability.
Learn how default parameters streamline computations like force and gravity, using default mass and gravity, and apply defaults in a tail-recursive factorial example to prevent infinite loops.
Uncomment and complete the module five exercises to practice function literals and placeholder syntax in the module five koans, with tests on partial functions, before moving to module six.
Augment Scala's built-in control structures by combining first-class functions to create convenient, easy-to-use alternatives. Build your own control structures using first-class functions to extend and tailor Scala 3 syntax.
Explore how higher order functions reduce boilerplate, implement the loan pattern for automated resource management, and leverage currying, arity zero, and by-name functions to craft natural syntax and custom loops.
Learn how to safely read and process file contents in Scala 3 using try/finally to guarantee file closure, and reduce boilerplate with a reusable higher order function.
Explore generics and higher-order functions in Scala 3 by building a with file contents utility that uses a type parameter, a function, and a default value.
Show how to find the most common letter in line in Scala 3 by lowercasing, removing spaces, grouping by identity, and map values to count, with a default to e.
Explore currying in Scala by transforming multi-argument functions into single-argument chains, using multiple parameter lists, and understanding when braces or parentheses enable semicolon inference.
Explore currying in methods by wrapping a single parameter in curly braces to enable semicolon inference, a syntactical trick for natural-looking generic control structures.
Explore the curried generic loan pattern by refactoring with file contents into a final parameter list and leveraging curly brace syntax. The loan pattern manages resource handling for clarity.
Explore function arity in Scala 3, showing arity one, arity two, arity three, and the function zero with empty parens that takes no arguments and returns a double.
Learn to implement a fruit loop in Scala 3, a curried loop with a predicate and unit side effect, producing squares 0 to 4 and contrasting with a while loop.
Explore by-name functions in Scala 3, compare them with function zero, and learn lazy evaluation of predicate and body via apply for concise control structures.
Explore classes and abstract classes, composition and inheritance, and how to extend and inherit from a superclass, call methods from a parent class, and override with final.
Explore abstract classes in Scala as templates, master the uniform access principle with lazy, lazy val, and def without parameters, and learn inheritance, overriding, and case classes for domain modeling.
Understand how Scala classes and case classes serve as templates to create instances, using private parameters, the is adult method, and companion objects with apply factory methods to instantiate objects.
Understand how new creates a new instance, and how equals and EQ distinguish content from identity. See how abstract classes cannot be instantiated and how Scala 3 syntax handles overrides.
Explore how abstract classes control access to private fields, and learn how to expose them in subclasses using parametric fields, public and protected modifiers, with examples of overrides.
Explore uniform access in Scala 3 by comparing def and val for class fields, explaining side effects and referential transparency, and when to use lazy val and parentheses.
Explore how val, def, and lazy val govern evaluation and memoization in Scala, showing val evaluated at creation, def evaluated on each access, and lazy val evaluated once and cached.
Explore how to implement inheritance in Scala with extends, creating a type hierarchy from abstract food to concrete fruit, and how overriding and polymorphism shape behavior.
Explore extending a parameterized abstract vehicle class in Scala 3, using the override keyword for fields, leveraging the primary constructor and auxiliary constructors, and calling super toString to customize output.
Explore an alternative way to define car in scala 3 by declaring name and age without a val, which makes them private and not parametric fields. Override val for clarity.
Explain the Scala 3 override keyword rules, when to mark overridden members, and the trade-offs of applying override for abstract versus concrete definitions.
Explore Scala 3 override rules with an abstract class example, learning when to override def versus val using the worksheet and REPL to test compiler behavior.
Explain why Scala marks equals equals as final in AnyRef to prevent overrides, preserving predictable behavior of top types like Any, AnyRef, and AnyVal.
Apply the final keyword to methods and classes to prevent override and extension, illustrated by marking string as final and restricting an Infinity class from being extended.
Mark a class as final to prevent extension, ensuring this implementation is the final one and its methods cannot be changed or made mutable.
Explore Scala case classes as immutable, value-like structures that provide boilerplate such as toString, equals, and hashCode, with a factory method and referentially transparent behavior.
Discover how case classes build Scala domain models in a single source file, modeling abstract vehicles and vehicle storage through aggregation as pure data objects like cars and parking structures.
Explore domain modeling in Scala 3 with an abstract vehicle class and a car case class, featuring name, description, full description, and the use of overrides for storage and counts.
Explore slides and interactive worksheets to experiment with concepts, undo changes, and learn how the pieces work together in this module.
Build a rolling stock domain model in Scala 3, with an abstract top class and concrete cars and engines, and centralize business logic in the middle layer.
Explore the type hierarchy in scala 3, including optional types, product types, and a survey of type algebra and type calculus in module eight.
Explore scala's type hierarchy from top classes to bottom types, covering calculus, primitive types, implicit conversions, value classes, extension methods, nothing and none, the option type, and equals and hashCode.
Explore Scala's top types: Any, AnyVal, and AnyRef, covering all values, including primitives and references. Learn their core methods, type checks, casts, identity operators, and synchronization at the reference level.
Explore differences between compile time and runtime types in Scala, including type erasure on the JVM, top types, and how any, any ref, and any val relate to casts.
Explore Scala's type hierarchy from the top: any, any val, value types such as byte, int, boolean, unit, and any ref with Java and Scala classes, plus null and nothing.
Explore how Scala handles the null type and a single null instance, explain the nothing type and phantom types, and preview a modification to make nulls explicit for safer code.
Explore how null causes runtime null pointer exceptions and how nothing sits beneath all types, guiding list typing through nil, matchable, and least upper bound concepts.
Discover how nothing acts in Scala's type algebra to allow exceptions via nothing, preserving a double when combining with nothing, and understanding how require and fail shape the type.
Explore Scala type calculus by examining type algebra, least upper bounds, and how null, nothing, and matchable determine the Scala type system.
See how Scala 3 cleans up type inference by removing the extra upper bound, so fruit no longer infers as product with serializable. Explicit supertype annotations aid Scala 2 compatibility.
Learn how implicit conversions in Scala perform type widening, turning ints into longs, enabling rich wrappers and methods on primitive values.
Explore how Scala 3 introduces rich wrappers and safe implicit conversions, highlighting long to double precision loss and the explicit to double fix, plus wrapper methods for numbers and strings.
Explore how specialized generates primitive-specific method variants for generic code via a type parameter and context bound, avoiding boxing by converting primitives to references when needed, while noting its complexity.
Examine the advanced @specialized generation in Scala 3, noting potential boxing when surrounding code isn't specialized. Decompile to verify generated code and use this power responsibly.
Learn how Scala 3 uses extension methods to add new operations to existing types, with a pig latin example on string and the shift from implicit classes to extension syntax.
Explore scala’s negative types: nil as the empty list terminator, null as a type, and nothing as a phantom type; none and option offer a safer alternative to null.
Explore how Scala's option type replaces nulls with safe handling of optional values, turning runtime exceptions into compile-time checks, using map to access length when a value is present.
Explore how the option type enables safe retrieval across maps and APIs, using get, getOrElse, and pattern matching to avoid runtime exceptions.
Explore how to use for expressions with options in scala 3 to safely access a word's fourth letter from a map, handling none with short circuiting.
Explore equals and hashCode in the JVM, why default implementations compare the type and memory address, and how to define custom versions to achieve meaningful equality for Scala objects.
Use IntelliJ's refactoring to generate equals and hashCode by selecting parameters in a dialog and auto-generating the code, a great approach until VS Code or Metals support it.
Explore implementing equals and hashCode by hand in Scala, using a canEqual check, isInstanceOf verification, and a name-based fruit example to ensure equals contracts and hashCode consistency.
Override equals in Apple to enforce reflexivity and type checks, rely on the fruit superclass equals for name, brand, and color, and compute a hash code using 31 as prime.
Choose case classes to auto generate equals and hashCode, keeping classes flat and reliable; avoid extending case classes to preserve correct equality and hashing, as shown in a banana example.
Explore Scala 3's multiversal equality, tightening equals with strict equality using can equal, derives, and given to prevent cross-type comparisons like apples and bananas.
Explore product types in Scala 3, including case classes and tuples, with automatic equals and hashCode, and learn about product iterator, arity, and elements.
Explore product types in Scala 3, focusing on case classes as practical, type-safe alternatives to tuples. Learn how case classes provide equals, hashCode, named fields, and reduce boilerplate.
Dive into module eight exercises to practice scala concepts, face compile warnings, and experiment by writing your own equals and hashCode, then return for module nine on traits.
Explore traits in scala 3 and how module nine tackles multiple inheritance with fewer problems. Discover that traits provide a new and interesting approach to inheritance challenges.
Compare traits with interfaces in Java, create and mix multiple traits, and explore linearization, stacking patterns, trait parameters in Scala 3, including abstract overrides and selfless traits.
Explore how traits address multiple inheritance, showing how overriding describe in car, classic car, and convertible requires choosing a super call, and how languages vary in resolving the method chain.
Compare Scala traits to Java interfaces: interfaces have no state, support single inheritance plus multiple interfaces; traits hold state and behavior and mix in with, solving diamond inheritance problem.
Explore defining traits in Scala 3, including abstract and concrete members, constructor parameters, and how they compare to abstract classes with practical code examples.
Learn how Scala 3 enables trait constructor parameters and how to extend a trait in a class, creating parametric fields like color (and optional name) for a car example.
Explore how Scala 3 traits serve as rich interfaces, enabling polymorphism via upcasting and delivering free methods from single-method implementations for functions and iterables.
Learn how traits enable mixing multiple components to create a classic convertible from an abstract car, using vintage and color fields with a power top to produce a description.
Explore trait linearization in Scala, where mixing traits rewires the super chain and the compiler processes traits right-to-left, prioritizing the last specified trait without skipping others.
Explore stacking traits with a car example, showing three layers from car to classic and convertible, to powered and hardtop convertible, and observe how linearization unfolds.
Explore stacking traits in Scala 3 by mixing classic, powered, and hardtop convertibles in different orders, and test the resulting behavior in a pop quiz style exercise.
Discover trait stacking and linearization in Scala 3 by tracing from hardtop convertible through classic and powered convertible to the final super type, a hardtop vintage 1965 powered red car.
Explore stacking traits and linearization in scala 3, tracing how hard top convertible, powered convertible, and classic determine the super types for convertible and car.
learn how trait parameters in Scala 3 solve initialization ordering problems by passing state through trait parameters, replacing lazy vals with safer, best-practice design for traits and abstract classes.
Apply just-in-time trait mixins during instance creation to form an anonymous subclass with intersection types, combining car, convertible, and classic.
cover module 9's abstract override in scala 3, showing how traits or abstract classes use linearization to call super, mark methods abstract, and require a final concrete implementation.
Implement the abstract by supplying the required color through a parametric field when creating an instance. The compile error appears if you misstep, and the abstract keyword signals pending fill-in.
Explore traits with type parameters and an upper bound, define a compare age trait, and implement older between two items of the same type, using a vintage car example.
Extend the compare age trait to any class with an age to identify the older instance. Provide an ordering by age implicitly so sorted can order a list of people.
Explore selfless traits in Scala 3: define a fully contained trait with a companion object you can extend or import, enabling flexible logging without tight coupling.
Practice implementing and stacking traits in Scala 3 through hands-on exercises in this module. When you're ready and understand them, come back for module ten.
Explore module 10 overview: packages, imports, and scoping for controlling visibility and access to methods, values, and classes in Scala.
Explore Scala 3 scoping: no public keyword, package visibility, and imports from packages, objects, and instances, plus top level methods and values and deprecated package objects.
Explore Scala's visibility scopes—private, protected, and public by default. Learn how companion objects share private state, how private[this] restricts to a single instance, and how protected enables access from subclasses.
Organize classes and objects into packages using the package keyword and dotted paths, mirroring Java in Scala. See how changing a package affects relative imports and explore alternatives.
Explore alternative Scala 3 package structures, including nested packages with braces, significant whitespace syntax, and namespace shorthand, noting that some forms are rarely used.
namespace notation clarifies scoping by showing how packages, objects, and classes nest under root, demo, food, and wine paths, with api and internal domains accessible through distinct paths.
Explore package scoping in Scala 3 with the demo food domain API, private domain access, and public lookup of desserts across subpackages.
Explore package visibility in Scala 3, including private, protected, package modifiers, and private this, with super package rules and cross-package access.
Explore how a top level logger domain interacts with relativistic imports, avoid same package name conflicts, and learn to access and force the use of that domain over local scopes.
Clarify the private wine domain versus the food domain, then import dessert and ice cream from the API, using curly braces to bring both into scope.
Discover how to import a logger from the top-level domain in Scala 3 by using underscore root to navigate up and then back down, like a Unix path.
Learn how Scala 3 enables top level vals and defs, making top level code straightforward. Compare this with Scala 2's package objects that house top level vals and defs.
Explore how imports work in Scala 3, including deprecation of package objects, importing from packages, objects, and instances, and using scoped imports with star syntax.
Explore how Scala 3 imports from an instance to bring in member names, such as dessert flavors from a food domain application programming interface, enabling testing while preserving production clarity.
Explore how Scala imports work from top-level packages and objects, then rename imports on the way in with rocket operator. Rename Jell-O to Jelly, and import everything else without renaming.
Explore selective importing in Scala 3 by omitting unwanted names, aliasing to preferred targets, and relying on standard imports from predef, java.lang, and Scala.
Explore how companion objects share private state and behavior with their class or trait, exist in same source file, may require importing, and the limits of accessing instance private data.
Practice imports and scopes by uncommenting and renaming imports, then implement the code to make module ten work, puzzle through the solution, and prepare for module 11.
A complete introduction to the Scala 3 language teaching you all you need to know in order to use it on a daily basis.
Scala 3 is a new version of a beloved functional hybrid language, one with many improvements over Scala 2. This course has been completely re-written for Scala 3, to introduce the new features, concepts, keywords and syntax. In addition the course exercises have been fully updated and brought to Visual Studio Code and Metals (the meta-language-server) for the hands-on portions of the course.
This course is half theory and half practice. Each subject covered includes worksheet based examples that you can experiment with, and exercises to complete allowing you to practice and reinforce what you have just learned in the theory.
The concepts are taught in a straightforward, simple approach with plenty of coding examples and clear explanations. Your instructor has more than 15 years of experience in Scala programming and more than a dozen years of experience teaching Scala to others.
Scala 3, just what you need, takes its title from two ideas, that the Scala 3 language could be just what you need to solve your programming problems, and that the topics covered are just what you need to quickly become productive in the language while still learning a lot of the theory and best practices surrounding Scala programming.
Come and learn Scala, at your own pace, from an experienced developer and trainer. Have fun while learning, and pick up the skills for using the tools and libraries as well as the core language.
Topics covered include:
Language and Syntax
Control Structures
Classes, Objects, Traits
Functions
Pattern Matching
Case Classes and Enums
Packages, Scopes and Importing
Inheritance and Scala Type Hierarchy
Testing
Lists and Collections
Java Integration
Using Libraries
Building Scala with SBT
Asynchronous Programming with Futures