
Please download the exercises attached to this lecture and unzip them somewhere on your machine where you can find them later. Also if you have not already done so, please follow the free course instructions at https://udemy-p.learnex.fyi/stairway-to-scala-setup-instructions/learn/#/ so that you are ready to run both the Scala REPL and the exercises when the time comes.
Thanks and enjoy the course. This is only part one of three, the second and third parts go further into using Scala on a daily basis for your programming.
Compare Scala's val and var: vals are immutable and cannot be reassigned, while vars are mutable, and the repl shows how new scopes can hide previous vals.
Explore that in Scala applied, part 1, if is an expression you can assign a value with val newName if args.length > 0 else default.txt, avoiding var and ternary operator.
Explore functional style in Scala by using worksheets in IntelliJ to implement max squared double, demonstrate try-catch-finally expressions, and reveal type inference and expression-based programming practices.
Create a Scala script times tables using nested while loops 1 to 5, 25 lines, with string interpolation, and use toString and contains to filter lines with 4 or 6.
Introduce IntelliJ Community Edition as the recommended IDE, explore Scala worksheets with demos, and cover method parameters, return types, expressions versus statements, tuples, rewriting rules, collections, and implicit extension methods.
Explore how to use IntelliJ worksheets to run Scala code interactively, and use src instead of Scala to avoid compiling top-level expressions.
Learn how to define methods with parameters and return types in Scala, compare explicit and inferred returns, and understand why parameter types cannot be omitted.
Explore Scala's rewriting rules that enable infix notation for a single-parameter method, showing how dot notation, map on lists, and charAt form same call and when an instance is required.
Learn how Scala rewriting rules ensure type checking and why an attempted rewrite may fail to compile. See how immutable lists show no update method, illustrating rewriting behavior.
Compare sequences and sets in Scala: arrays and vectors are ordered sequences with duplicates, while sets enforce uniqueness and may not preserve insertion order, using hash or tree variants.
Explore mutable versus immutable collections in Scala, comparing arrays, lists, vectors, and sets, and learn how var and val, plus equals, and rewrite rules govern updates.
Learn to run and fix module 2 Scala exercises in IntelliJ, making tests pass and using dot deep to compare arrays. Understand array equality quirks and progress toward list immutability.
Explore core Scala concepts by examining classes, objects, and applications. Learn the ins and outs of the language itself.
Define classes and constructors, explore parameters and fields, and illustrate with a rational number class. Examine preconditions, self reference, infix notation, operator overloading, auxiliary constructors, companion objects, and implicit conversions.
Learn to define a Scala class with the class keyword, include fields and methods in the body, instantiate with new, and see initialization code run.
Explore a rational class with parametric fields, a toString, and a min method that compares two rationals using double precision, and reference the current instance with this.
Explore the remaining control structures in Scala, completing the language feature overview after covering classes, and prepare for future modules featuring new or unique language features.
Learn how to return values beyond unit in scala with a file writer example, using open close friends to signal side effects and manage resource lifecycles.
Explains returning this instead of unit to enable fluent API chaining with a writer output; writes strings and returns the same reference, offering a fluent, though not referentially transparent, pattern.
Explore val versus var in scala and how the IDE flags mutable variables. Customize IntelliJ color hints to highlight local and template variables and promote val-centric, expression-based practices.
Learn how the for expression in Scala is not just looping, but a powerful tool for composing futures, options, and Try, enabling asynchronous, non-blocking code with yield.
Explore advanced pattern matching in scala by handling various kinds of data, including any type, strings, and lists, using case statements and a default case to prevent exceptions.
Explore string interpolation in Scala, using s-interpolator for values and expressions in braces, f-interpolator for formatted numeric output, and raw or triple-quoted strings with stripMargin for multi-line literals.
Practice module four exercises in Scala applied by running tests in IntelliJ, writing code to pass, and trying first before consulting solutions; then module five on functions and function literals.
Examine private and nested methods and master function literals, higher-order and first-order functions in Scala. Learn placeholder syntax, underscores, partial application, closures, partial functions, varargs, and named or default parameters.
Explore how nested method scoping in Scala allows inner methods to reuse outer variables, removing redundant parameters, and how deep nesting is possible yet should be used sparingly.
Discover function literals in Scala, aka lambdas, and their interchangeable use with methods. Learn converting a method to a function literal with the rocket operator and the int-to-int function type.
Explore function literals in Scala, using anonymous and named lambdas, and apply them with map to compute squares and boolean predicates, while understanding type inference and higher-order functions.
Scala generates extra methods on functions, including curried and tupled. Currying yields single-argument functions, while tupled accepts a tuple, enabling later use and turning it into a case class.
Explore higher order functions by examining map, filter, span, and partition, which take or return functions. Learn how predicates and function literals produce booleans and how first order functions differ.
Demonstrates how map may be unsafe with a partial function, while collect, match with cases, and try catch define a partial function that both specifies inputs and restricts validity.
Learn how var args complicate calling methods, and use the expansion operator, colon underscore star, to pass a list as var args, especially in recursion.
Explore how higher order functions in Scala simplify code, enable resource management via the loan pattern, and use currying, arity, and by-name functions to craft a native-feeling loop.
Explore the loan pattern in Scala by currying a generic loan to manage a resource, separating file handling from the operation, and enabling clean up with first-class functions.
After taking Scala Applied part 1, you will be able to:
Use the REPL (the Scala Interactive Shell) for experimentation and fun
Understand the basics of Scala syntax, including val, var, def, if, while, try, for and more
Create classes, objects and instances
Define and use function literals and higher order functions
Understand the basics of Scala's type inference and how to use it
Write custom control structures to augment those built into the language
Start down the path of a more functional style of programming
Be ready for Part 2 of Stairway to Scala Applied, which will dig into some of the differences between Scala and other languages
The course is half theory, half practice with hands on coding exercises built around test driven development examples. If you complete all three parts, with all the exercises, you will find that in addition to a strong grounding in the language theory, you will have the practical skills and comfort to code in Scala, as well as having the tools necessary to do so.
Unlike many other courses that teach a specific aspect of the Scala language, for example reactive programming or functional concepts, Stairway to Scala Applied provides a balanced and thorough introduction to the whole language and its concepts, including libraries like Actors and Collections. It is intended to accelerate your Scala learning curve and make you able to use Scala productively by the end of the course.
The course is taught by two highly experienced Scala developers who use Scala on a daily basis for real world commercial projects, and have done so for several years each.
Most of the lectures are practical demonstrations accompanied by a slide. You can download the slide deck and follow along on your computer, but the lectures are also presented using Udemy mashups, so the slide and practical demo can be switched between at will. If you hear typing, it's best to bring up the practical demo screencast instead of the slide in order to follow along.