How I Would Like to Learn Scala

After three years of Scala learning and use, one dev wants others to follow a better, simpler path to learning the language - an object-oriented view.

· Java Zone · Opinion

I want to share with you a small piece of my project. It’s about Scala. To be more precise, it’s about the simplest way of learning Scala. Why did I say the simplest? Well, because I have a solid knowledge of mainstream problems that occur during Scala studying. 


After three years of Scala usage, I can confidently say that it’s an awesome programming language. Looking back to the days when I started learning Scala, I feel stupid because I didn’t follow going about it in an optimal way. My attempts to understand Scala concepts were unsuccessful. It was only through persistence that I first achieved some results.

So, here's my vision of the Scala learning process.

The Problem

Here is a well-known fact: Scala allows you to write the same thing in many different forms. From one side, it’s nice, because you have a large variety of decisions. But from the other side, programming is not a good place for writing free-form thoughts.

Here is an example of function declaration in different forms:

def sum(a: Int, b: Int): Int = { a + b }

def sum(a: Int, b: Int) = { a + b }

def sum(a: Int, b: Int) { a + b }

def sum(a: Int, b: Int) =  a + b

As you see, even in so simple an action as function declaration, we have multiple methods of going about it. The further we go, the harder things become for us to understand. Of course, this can be easily solved by introducing a code guide. Then, the only thing you need to do is to learn the basic forms of the main language construction.

Keep in mind that I’m speaking from a Java developer's perspective.

Additional complexity makes the syntax and functional programming. Furthermore, you never know what topic needs to be learned next. Which came first, the chicken or the egg? In Scala, I can ask you, "Which came first, a case class or pattern matching?" Or maybe an apply function?

Despite this circumstances, I choose Scala over Java

How I Would Learn It

I decided to start teaching from the most familiar topic for Java developers — object-oriented programming. Scala has its own OOP implementation, and it’s very similar to Java 8, including functional interfaces. So, there is nothing more trivial than Scala OOP for Java developers.

Here is a short promo video:

As soon as I collect enough comments regarding this mini video course, I’m going to complete the rest of the video lecture. I invite you to join the first group of “beta” students and leave your feedback about it. Almost 1 hour of content is waiting for you. Try the most unappreciated JVM programming language!

Get your free copy of the course by heading over to my site and filling out the form.

Published at DZone with permission of Alexey Zvolinskiy, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.