Scala 2 Methods and Functions
Scala is emerging as a popular choice for working with large datasets and frameworks such as Spark. This course will teach you about Scala's support for first-class and higher-order functions and the differences between methods and functions.
What you'll learn
Working with Big Data these days increasingly requires an understanding of functional programming constructs, because of how easily functional code can be distributed. Scala is a general-purpose programming language that runs on the JVM and supports both functional and object-oriented programming paradigms.
In this course, Scala Methods and Functions, you’ll learn to utilize those aspects of Scala that are specific to the functional programming paradigm.
First, you'll see how variables with different type modifiers are assigned and evaluated and you’ll understand the differences between Scala val, var, lazy val, and def keywords.
Next, you’ll discover the attributes of first-class functions, and the use of higher-order functions and partial functions in order to simplify code design.
Next, you’ll learn how to harness the power of features for Scala methods such as currying, recursion, named and positional arguments, and varargs.
Finally, you'll learn how to deal with missing values and errors in Scala and work with functional error handling idioms such as Try-Success-Failure, Option-Some-None, and Either-Right-Left.
When you’re finished with this course, you’ll have the skills and knowledge of functions and methods in Scala needed to write correct, concise, yet easily understandable code that combines the power of the functional programming paradigm with a strong static type system.
Table of contents
- Version Check 0m
- Prerequisites and Course Outline 3m
- Functional Programming and Distributed Computing 6m
- Functional Constructs in Scala 5m
- Demo: Environment Setup and Hello World 4m
- Demo: var, val, lazy val, and def Using a Scala Worksheet 5m
- Demo: The var Type Modifier 3m
- Demo: The val Type Modifier 3m
- Demo: The def Keyword 5m
- Demo: The lazy val Type Modifier 4m
- Functions and Methods 5m
- Demo: Functions and Methods I 5m
- Demo: Functions and Methods II 4m
- First Class Functions 2m
- Demo: Functions Literals 4m
- Demo: Placeholders 5m
- Demo: Complex Operations Using Placeholders 6m
- Demo: Partially Applied Functions 7m
- Demo: Partial Functions 4m
- Demo: Partial Functions with Pattern Matching 5m
- Demo: Higher Order Functions 7m
- Demo: Closures 6m
- Demo:Function Invocation with Expression Blocks 3m
- Demo: Higher Order Function Invocation with Function Literal Blocks 5m
- Introducing Methods 2m
- Demo: Methods 4m
- Demo: Currying 5m
- Demo: Type Parameters 4m
- Demo: Method Evaluation Strategies 6m
- Demo: Positional and Named Arguments 4m
- Demo: Method Invocation with Default Arguments 4m
- Demo: Curried Functions with Default Arguments 2m
- Demo: Parameterless and Empty Paren Methods 5m
- Demo: Varargs 5m
- Demo: Nested Methods 6m
- Demo: Recursion 4m
- Demo: Tail Recursion 6m