Learn By Example: Scala

Video description

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.

What You Will Learn

  • Use Scala with an intermediate level of proficiency
  • Read and understand Scala programs - including those with highly functional forms - written by others
  • Identify the similarities and differences between Java and Scala, and use both to their advantage

Audience

The suitable audience for the course is only if you know Java and are now looking to learn Scala from first principles and if you are interested in learning functional programming concepts as embodied in Scala.

About The Author

:

Publisher resources

Download Example Code

Table of contents

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

Product information

  • Title: Learn By Example: Scala
  • Author(s): Loonycorn
  • Release date: December 2017
  • Publisher(s): Packt Publishing
  • ISBN: 9781788993005