Scala is one of the most popular functional programming languages that run on the JVM. This course covers the fundamentals of functional programming using Scala, reading and writing Scala code, error handling, classes, and concurrency.
Functional programming requires learning new programming paradigms, and Scala is an excellent language with which to do so. In this course, Scala: The Big Picture, you will learn the Scala language from scratch as a first step in your journey to master the language. First, you will learn the basics of functional programming which you’ll apply throughout the rest of the course. Next, you will explore the Scala language, from the basic syntax to functions, classes, collections, and pattern matching. Finally, you will discover how to do concurrent programming the right way using Scala. When you’re finished with this course, you will have the foundational knowledge needed to solve problems using Scala, and will know how to get help when needed.
Harit Himanshu is an engineer by profession with the deep interest in applying technologies to solve business problems. Harit is passionate about writing clean, modular, testable code and believes in automating almost everything.
Course Overview (Music playing) Hi everyone. My name is Harit Himanshu, and welcome to my course Scala: The Big Picture. I'm a software engineer at a FinTech startup based out of San Francisco. Scala is one of the most popular language and enterprises that runs on a Java virtual machine. It has been successfully deployed to production at companies like Samsung, Verizon, Walmart, Twitter, and many more. Learning Scala opens doors to programming methodologies such as functional programming and doing concurrency the right way. It also encourages you to write clean and testable code while writing less code at the same time. In this course, you are going to cover the key topics in Scala that can help you learn and practice the language as you go. Functional programming concepts and how they relate to the Scala code, learning about classes and more importantly, functions, to help you grow on your journey to become a functional programmer. Scala collections library, to get inside and power provided by the language to us as programmers to use. Concurrency to help you gain other and better ways to write asynchronous code which behaves in a predictable manner. By the end of this course, you will be able to read and write Scala programs to solve problems that you encounter in your programming requirements. Before beginning this course, you should be familiar with at least one programming language. You should be familiar with the concepts such as methods, functions, variables, and arguments. I hope you'll join me on this journey to learn Scala with Scala: The Big Picture course at Pluralsight.
Introduction Hello there. Welcome to this course on Scala: The Big Picture. This is going to be an exciting journey by learning new concepts and working with Scala, which will make you a better and a productive programmer. Let's take a look on what we will cover in this course. First, we will see why as a programmer you should consider learning Scala. Then we will cover what this course has to offer during the entire learning journey and what you should expect to take out from this course. Next we will install Scala and Scala plugin for IntelliJ, which will help you write and run programs on the command-line and in an IDE environment. We will also see what Scala REPL and Scala Plugin for IntelliJ looks like. So without any further ado, let's dive in.
Functional Programming Concepts Welcome to the module on the Functional Programming Concepts. In this module, we are going to cover the following topics. First, we will learn what immutability means and cover some of the examples. Then we will see what expressions and statements are by doing the examples. Then we will review functions. We will define what functions are, and then look at pure and impure functions. We will learn here how to differentiate between the two. Next we will cover what referential transparency is and why is that important. And finally, we will cover the higher-order functions and learn how to maximize the code reuse by looking at a specific example in action.
First Interaction with Scala Hi, welcome back. In this module, we are going to cover our first interaction with the Scala code. We are going to run some examples on the Scala REPL, understand the output on the screen, and we will also look at some of the features of the Scala REPL. Next we will look at variables and values. Then we are going to cover about conditionals. Almost every programming language has if loops, but Scala may surprise you for one reason, and we will see shortly why is that. Loops are some of the most fundamental ways to perform iterations of works, and we will learn different ways to perform loops in Scala. And that's it. By the end of this module, you will know how to read Scala code base, run experiments on Scala REPL, and perform loops and conditional behavior in your own code. So let's dive in.
Functions Hi, in this module we are going to look at the functions. We will first look at the difference between the structure of the functions. There are often times when we only need to provide the body of the functions without providing their name, since I'd used just once. We will see how to represent the anonymous functions here. We have learned about the higher-order functions in the past, but this time we will work on them especially in the context of Scala. So let's dive in.
Classes Hi. In this module, we are going to cover all about classes. We will first look at the structure of the class. Here we will dive into the syntax of what makes a class. We will cover about the class fields and methods. We will then look at the companion objects, which may be new to you based on your background in other programming languages. We will then look at special way to construct the objects in Scala using the apply method. Then we will dive into the case classes. These are one of the best ways to create classes in Scala and we will learn why. We will also learn to launch the standalone program by extending the application trait. During all these times, we will try to give as many examples as possible. So, let's start the work.
Null Checks and Error Handling Hi, in this module we are going to go over a very important topic around the absence of values and error handling. In programming languages, it is generally denoted by a null value. We will first cover why null checks are considered bad in the code base, then we will look at the option, which is a better and cleaner alternative to null checks. Then we will show you how error handling is performed in common imperative programming languages. We will then demonstrate how using try in Scala can provide a functional alternative to error handling. Here we will also cover error handling mechanism using either in Scala. By the end of this module, we will learn a functional way of checking null values and error handling.
Pattern Matching Hi. In this module, we are going to cover pattern matching, which is a very important topic in functional programming. We will first look at what the pattern matching is, and then we will cover various ways to perform pattern matching with constant values. Then we will see how to perform pattern matching on case classes. Then we will see the examples of pattern matching on sequences. We will then see how to perform the pattern matches on the type of an element. And finally, we will learn about guarding your matches, which means to apply the pattern matching selectively. Let's dive in.
Collections Hi, in this module we are going to cover collections. First, we will quickly summarize the benefits of learning to use Scala collections library. Then we will look at how collections are organized in the Scala library. Then we will look at the collections hierarchy diagram to gain more understanding about the relationship between the types of collections that are available for our dues. We will then pick our first collection list and learn more about them. Then we will cover set collections with examples. We will then see map collection and gain more understanding about using them. Performing aggregation collection is a very common operation in programming languages; here we will learn how to aggregate on collections using higher-order functions. Filtering again is a very common operation that is performed on collections while programming. We will learn how higher-order functions can help us write compact and elegant code. It is very common while programming to transform elements of a collection into a different type. Again, using a higher-order function, we can help write the program that can transform one collection into another using the elegant and compact manner. Then we will look at the flatMap, which is very often used when working with collections. And finally, we will look at how options and flatMap work together. This is going to be an action-packed module with many examples, so without any further wait, let's dive in.
Concurrency In this module, we are going to cover the topic about the concurrency in Scala. We will first look at concurrency versus parallelism. Then we will cover Futures, along with ExecutionContext, which represents a computation that we'll eventually complete. We will relate this to threads and what ExecutionContext means here. Then we will cover how we can transform the Futures into some other shape or form. Since the Future returns a computation, there are chances that we may want to filter or collect the result for future use. Here we will see how that is possible. Future is not the only way to represent the asynchronous computation in Scala. Here we will see other constructs that as a developer we could use. A Future does not always represent a successful computation. We will discuss here how to deal elegantly with failures when working with asynchronous computations.
What’s Next? Now that we have covered the basics of Scala, you are ready to do some of the Scala programming by yourself. Some of the things that we will cover in this module to guide your learning journey are, experimentation with the Scala REPL, exploring the Scala API, source of programming problems that you can solve using Scala, and where to ask help in case you get stuck with an issue. So let's look at them.