O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learn By Example: Scala

Video Description

65 examples that will bring Scala to life for you

About This Video

  • The Big Ideas: Before we get to the how, we better understand the why - this course will help clarify why we even need Scala when Java serves us so well
  • The Little Details That Matter: Pattern Matching, If Expressions, For Loops & Yield: Java has if-statements, while Scala has if-expressions. Differences like these matter, this course will cover them.
  • First Class Functions are perhaps the most dramatically new feature of Scala - the foundation of functional programming support.
  • Collections - Lists, Options, the Details of fold/reduce/shift in Scala are yet another bit of the language that differs significantly from other traditional object-oriented languages. We will spend a lot of time on these topics too.
  • Classes, Companion Objects, Traits, Self Types and Dependency Injection are Scala's way of providing Object Oriented support. Some of these concepts are similar to Java - those we will skim over. Others are quite different - we will be sure to cover these in detail.

In Detail

These 65 examples will make this cool-new-kid-on-the-block your steady, reliable friend. Let’s parse that. Scala is cool because it’s all the rage for big data applications, and because it manages to be more sophisticated and elegant than Java. That said, Java is a steady, reliable friend - a language you can depend upon, and in which you can express yourself. These 65 examples will help you trust Scala the way you trust Java. Each is self-contained, has its source code attached, and gets across a specific Scala use-case. Each example is simple, but not simplistic.

Table of Contents

  1. Chapter 1 : You, This Course and Us
    1. You, This Course and Us 00:02:22
  2. Chapter 2 : Introducing Scala
    1. Introducing Scala: Java's Cool Cousin 00:10:12
    2. Installing Scala 00:09:43
    3. Examples 1 and 2 - Hello world 00:05:05
    4. Example 3 - Mutable and Immutable ‘variables’ 00:05:16
    5. Example 4 - Type Inference 00:06:34
    6. Example 5 - String Operations 00:04:30
    7. Example 6 - A Unified Type System 00:05:29
    8. Example 7 - Emptiness in Scala 00:05:40
    9. Example 8 - Type Operations 00:03:54
  3. Chapter 3 : Expressions or Statements?
    1. Module Outline - Loops and Conditionals 00:00:30
    2. Example 9 - Statements v Expressions 00:05:58
    3. Example 10 - Defining Values and Variables via Expressions 00:02:29
    4. Example 11 - Nested Scopes in Expression Blocks 00:04:34
    5. Example 12 - If/Else expression blocks 00:05:22
    6. Example 13 - match expressions 00:05:39
    7. Example 14 - match expressions: Pattern guards & OR-ed expressions 00:04:27
    8. Example 15 - match expressions: catch-all to match-all 00:06:14
    9. Example 16 - match expressions: down casting with Pattern Variables 00:07:00
    10. Example 17 - for loops can be expressions OR statements 00:07:48
    11. Example 18 - for loops: 2 types of iterators 00:03:17
    12. Example 19 - for loops with if conditions: Pattern Guards 00:02:39
    13. Example 21 - while/do-while Loops: Pure Statements 00:03:33
  4. Chapter 4 : Fiber Optic Cabling
    1. Module Outline – Functions 00:00:28
    2. First Class Functions: Module Outline – Functions 00:07:30
    3. Functions v Methods 00:06:05
    4. Example 22 - Functions are named, reusable expressions 00:06:07
    5. Example 23 - Assigning Methods to Values 00:09:00
    6. Example 24 - Invoking Functions with Tuples as Parameters 00:05:58
    7. Example 25 - Named Function Parameters 00:03:39
    8. Example 26 - Parameter Default Values 00:03:59
    9. Example 27 - Type Parameters: Parametric Polymorphism 00:07:13
    10. Example 28 - Vararg Parameters 00:04:57
    11. Example 29 - Procedures are named, reusable statements 00:05:30
    12. Example 30 - Functions with No Inputs 00:03:41
    13. Example 31 - Nested Functions 00:04:05
    14. Example 32 - Higher Order Functions 00:07:38
    15. Example 33 - Anonymous Functions (aka Function Literals) 00:02:44
    16. Example 34 - Placeholder Syntax 00:07:00
    17. Example 35 - Partially Applied Functions 00:07:22
    18. Example 36 – Currying 00:07:02
    19. Example 37 - By-Name Parameters 00:09:01
    20. Example 38 – Closures 00:10:12
  5. Chapter 5 : Collections
    1. Module Outline – Collections 00:00:28
    2. Example 39 – Tuples 00:10:31
    3. Collections: Example 39 – Tuples 00:08:53
    4. Example 41 - Simple List Operations 00:07:48
    5. Example 42 - Higher Order Functions Introduced 00:12:49
    6. Example 43 - Scan, ScanFold,ScanReduce 00:11:51
    7. Example 44 - Fold, FoldLeft, FoldRight 00:02:28
    8. Example 45 - Reduce, ReduceLeft, ReduceRight 00:05:22
    9. Example 46 - Other, Simpler Reduce Operations 00:02:40
    10. Example 47 - Sets and Maps 00:11:23
    11. Example 48 - Mutable Collections, and Arrays 00:10:04
    12. Example 49 - Option Collections 00:05:55
    13. Example 50 - Error handling with util.Try 00:04:07
  6. Chapter 6 : Classes and Objects
    1. Module Outline – Classes 00:00:34
    2. Example 51 – Classes 00:10:03
    3. Example 52 - Primary v Auxiliary Constructors 00:04:00
    4. Example 53 - Inheritance from Classes 00:06:04
    5. Example 54 - Abstract Classes 00:02:49
    6. Example 55 - Anonymous Classes 00:02:59
    7. Example 56 - Type Parameters 00:03:14
    8. Example 57 - Lazy Values 00:04:27
    9. Example 58 - Default Methods with apply 00:04:17
    10. Example 59 – Operators 00:04:30
    11. Example 60 - Access Modifiers 00:05:26
    12. Example 61 - Singleton Objects 00:05:34
    13. Example 62 - Companion Objects 00:09:10
    14. Example 63 – Traits 00:06:11
    15. Example 64 - Case Classes 00:03:25
    16. Example 65 - Self Types 00:07:19