Why You Should Learn Scala in 2021?

Marcin Krykowski
4 min readApr 11, 2020

--

While going through the internet you can find many questions like: Is it still worth learning Scala? Is Scala relevant in 2021? What is better than Scala? Java or Scala — comparison anyone? And many many more. You can find many Reddit answers or other blog posts explaining this, but in the article below I’d like to explain why you should start learning Scala from my point of view.

Photo by NESA by Makers on Unsplash

1. Soft Transformation to Functional Programming

Scala supports two paradigms of programming: The object-Oriented approach and Functional programming. For those who are familiar with Java, Kotlin, or any other OO programming language it will be really easy to start writing code in Scala in ‘a little bit like Java’ style. At the same time, you will be discovering more and more Scala’s features and its advantage with the FP approach. It’s much easier than Haskell or Lisp. In Scala, you are not meant to get everything right away before writing a single line. At some moment using stuff like monads, case classes or pattern matching will be an obvious choice.

2. Compatibility with Java

The Scala ecosystem is constantly growing. The number of great libraries and frameworks is amazing. Scala also supports new technologies like Data Science or Blockchain with its amazing tools. Yet if you have your one favorite Java library you can easily adapt it to Scala’s environment because Scala is running on JVM. Same as Java.

3. Open&Growing Community

No matter if you are a self-learner, want to attend a Bootcamp or just looking for some bits of advice on the internet you’ll find huge and very willing to help Scala community. More and more companies (Twitter, New York Times) decide to use Scala within production because it works!

Photo by Émile Perron on Unsplash

4. Concise Syntax

Scala has succinct syntax. Let me show you an example.

In Java:

package gsmav4.es12;

import java.util.Objects;

public class Product {
private String name;
private double price;

public Product(final String name, final double price) {
this.name = name;
this.price = price;
}

@Override
public int hashCode() {
int hash = 7;
hash = 23 * hash + Objects.hashCode(this.name) + Objects.hashCode(this.price);
return hash;
}

@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Product other = (Product) obj;
if (!Objects.equals(this.name, other.name)) {
return false;
}
if (Double.doubleToLongBits(this.price) != Double.doubleToLongBits(other.price)) {
return false;
}
return true;
}

@Override
public String toString() {
return "Product{" + "name=" + name + ", price=" + price + '}';
}
}

While in Scala:

case class Product(name: String, price: double)

Yes, that’s enough! And both examples work in the same way.

5. Market

We all are developers because we love it, we can spend dozens of hours per day and not get paid because coding is our passion, isn’t it? 😉 With things like learning a new language, learning new frameworks&libraries, learning a new approach (FP), what you can all do by getting to know Scala, you will grow on the market. Your value will be bigger than people who only know one language or even two, but both OO. When you look at 2019 stackoverlfow.com annual survey

https://insights.stackoverflow.com/survey/2019#top-paying-technologies

you’ll see Scala at #1 rank in salaries in the US. And the demand is growing.

Photo by Austin Distel on Unsplash

6. Productivity

I’m sure that with Scala your productivity will grow. First of all, you can start immediately with some basic knowledge. The second thing is you can deliver much more code while writing less! It’s amazing. Having great tools to start with like IntelliJ (adding a Scala plugin is enough and it’s free) will make your work a pleasure.

Yet you have a few reasons above but you can find many articles similar to this. Why? Because people love Scala, really enjoy coding with it, and want to engage more and more people. Just give it a try. If you want to learn more about Scala or software engineering stay with the blog or drop me a message: marcin.krykowski@gmail.com. Looking forward to hearing from you!

You can find me also on Twitter: @marcinkrykowski

If you like my post comment & share it wherever you want!

Also, I encourage you to sign up for my newsletter https://brandingfordevs.substack.com/.

--

--

Marcin Krykowski

Entrepreneur, Software Engineer, Business Advisor, Self-Management Fan