This course will help you transition from programming in Java to programming in Scala. It's designed firstly to help you get started with Scala, translating what you already know in Java to Scala. Then, with the language syntax under your belt, it introduces functional programming concepts to give you a head start writing Scala in a functional style. Lastly, the course outlines some tips and advice useful when transitioning existing Java projects and teams to Scala.
Toby is an independent software developer based in London. He's written for Jaxenter and is the author of Essential Acceptance Testing on Leanpub.com. He specializes in modern software development and agile practices.
Section Introduction Transcripts
Section Introduction Transcripts
Introduction to Scala Hey folks, I'm Toby Weston and welcome to this course on Scala for Java Developers. This is an introductory Scala course designed to help Java developers get started with Scala without necessarily adopting all of the fancy features. Scala is both an object oriented language and a functional language, and although I'll talk about some of the advantages of functional programming this course is more about being productive with imperative Scala and get into groups with the functional program inside of things. I'm planning a follow up course to cover functional idioms in Scala, which you might want to check out. The course is alike for like style course so if you do a particular thing in Java one way I'll show you how you might do the same thing in Scala, along the way we'll be introducing the Scala language syntax. So the course is split up into four main sections or modules, in this first module we're going to take a high level tour of Scala, you'll get a feel for the language constructs and how Scala is similar in a lot of ways to Java, but yet very different in others. We'll take a look at installing Scala and using the interactive interpreter we'll go through some basic syntax examples. Module two talks about the key differences between Java and Scala, we'll look at what's missing in Scala compared to Java, and how concepts translate from one language to the other. Then in module three we'll talk about what Scala offers that Java doesn't. Finally in the fourth module we'll talk about adopting Scala into legacy Java projects and teams, it's not always easy to transition, so we'll look at why you might want to, and some of the challenges you might face.
Beyond Java to Scala Welcome to module 3. The last module was all about the differences between Java and Scala. This module is all about the differences between Scala and Java. There are plenty of language features in Scala that don't have an obvious analog in Java, so in this section we'll take a closer look at some of those and explore what Scala can give us over Java. Specifically, we'll explore some of the language features that make writing Scala more expressive, and we'll look at some of the more functional programming idioms that Scala is so well-known for. Scala offers several features that make writing code more concise, as well as some we've already seen. It provides mechanisms to make methods look like functions using a special case apply method, provide default behavior for the assignment operator using a special case update method, make regular method calls look like language structures, which in effect means you can define your own control structures. Scala also offers pattern matching, and we'll be taking a look at the unapply method and its role in pattern matching. We'll cover each of these, one per video, so that it is easier to digest, and you can come back to specific parts as and when you need to. Then we'll take a look at some of the functional programming aspects to Scala. We'll look at the built-in methods for mapping values, map and flatMap, what monads are and why you should care, the Option class as a way of avoiding null checks, chaining monad calls, and look at how for- comprehensions work under the hood. This only really scratches the surface of functional programming, but I hope that it will give you a useful head start when it comes to Scala and functional programming. Let's start by looking at the theme of expressive Scala and faking function calls.