Is Scala-lang good for beginners?

It depends what you mean by systems programming. Scala is great for things like database drivers, web servers, text mining, parallelization of jobs, etc. etc.–what you’d normally call “backend development”. That is, it’s good for most things anyone would ever do.

But it’s not great for hardware access, small latency guarantees, core operating system code, virtual machines, etc. because its designed with the abstraction present in the JVM or similar execution environment in mind. Most of the cases where systems programming is really different from everything else (or where systems programming and embedded programming overlap) aren’t in Scala’s sweet spot, even with scala-native.

For instance, languages with that as their sweet spot tend to emphasize RAII as a strategy for dealing with resources. Scala is designed with GC in mind–which is a simpler strategy for dealing with the most common resource, memory; but with that lower-level systems programming you have a LOT of resource constraints so it’s a language that has features that make it easier. Even if you get support in scala-native, you can’t really take advantage of Scala libraries because they weren’t written with that in mind. (E.g. if you return xs.take(3) from a method, the collections library isn’t written to run a destructor on xs (but only on the elements that are not taken), so if these happen to be file handles you’re in trouble…they’ll leak unless you remember to close them manually.)

2 Likes

A program that written by Scala in Linux, can run on Windows?
How about Job positions?

In my experience, C++ is probably harder than Scala overall. If you have experience with C you should be good to go. Plus you don’t have to worry about pointers. In my opinion, Scala is a terrific language per se. However, I can’t say I really like any of the JVM build tools I’ve encountered.

EDIT: just wanted to second things people have said in here about doing things the C way not being idiomatic in Scala. You can do things like this but it’s usually not encouraged.

For the most part, yes, but it depends on what it is trying to do. The operating systems are different, so there are things you might do on Linux that won’t work correctly on Windows, and you will often need to configure things a little differently. But most programs will run pretty much the same.

Broadly speaking, there aren’t as many Scala jobs – it’s a smaller market – but Scala jobs tend to be higher-paying than almost any other language (according to several surveys). And while there aren’t a ton of Scala jobs, the market is still pretty hot: there are lots of companies looking for skilled Scala programmers. (My own employer is hiring a bunch of positions.)

So basically – you won’t find Scala jobs everywhere. But if you get good at Scala, there are companies desperate to hire you.

1 Like

According to Stack Overflow Developer Survey, Scala was top paying language in United States in

2020

and in 2019

and shared the top spot in 2018

and shared the top spot in 2017

and shared the top spot in 2016

1 Like

I would take these statistics with a grain of salt. These only include medians, not full distributions. They also don’t reflect the “market share” of Scala, which I’d guess is significantly smaller than Java and Python.

Plus, there’s the hypothesis that Scala is used more often among data scientists who get better compensation – you first have to become a data scientists and only then learn Scala.

There are inevitably a lot of factors that put Scala at the top of the list. I’m not as convinced by the “data scientist” argument though, mainly because Scala has been stable at the top of the list back to 2016. I think a bigger factor is that Scala positions seem to rarely be for junior developers.

2 Likes

For me the learning curve was more about all of the options and inconsistencies.
They are everywhere. When starting out there seems to be no consensus on how to do anything. Concurrency for example. Everything in Scala comes with 100+ ifs ands or buts, coulds, maybes and mights. Since there are so many ways to do anything you will see everything done differently and rarely will you really get a good reason as to what the best way is because everyones way is the best. The api can be confusing at first because you have objects,classes and traits with the same name and you have to click the icon to swap them out to see the members etc. One of the hardest things to figure out is the best way to do concurrency, I am sticking with Akka to start with, there are so many other options though that it requires days of research beyond Akka.

When first learning Scala you will spend more time googling, digging and reading than actual programming, because there are no agreed 1 or 3 ways to do anything you must investigate every way to make sure you fully understand what you are doing, this makes you feel more like a detective than a developer. The fact that there are so many ways to do every last thing means you will spend far more time learning Scala than most other languages.

But with lots of options comes lots of power. You have the power to choose how you want to do anything. It is frustrating at first but there are so many cool libraries and frameworks and you can do so much that in the end it is worth it. I think there is a major opportunity for someone to write a Scala book about best practices and gotchas, but by the time most people figure it all out they are too busy with other work. LOL

I never considered careers or anything. I just investigated Scala after using PHP for many of my last projects. I also have learned PERL, Java, BASH, Javascript, Actionscript and more. For my current project I even looked into Golang, Rust and Swift, not deeply though. For what I want to do, a very complex social platform with AI and Crypto financial, Scala and it’s tools seemed the best fit possible.

The learning curve is steep mostly because of what I mentioned. Otherwise you can code Scala pretty much just like OOP Java, but I refuse to do that and Scala tries to force you down the functional road.
Here is a list of resources for Scala newbs https://akashicseer.com/resources/random-scala-stuff-for-newbs/
I actually started the site while learning Scala because I needed somewhere to organize the useful information I found because there is lots of bad info out there.
A list of best practices https://akashicseer.com/resources/scala-best-practices/
A really long list of random Scala resources https://akashicseer.com/resources/scala-resources/

I have several pages of Scala resources just type Scala into the search bar. I keep adding articles and resources daily.
But Scala isn’t something you just learn. It is something you keep learning. It is very computer sciency and academic but very useful.

One of the things I like about Scala is the type system. It is a pain, but if your code compiles there is at least a 90% chance it is bug free except for logical errors. Scala isn’t a language for lazy people and probably not for someone that just wants to make the most money. The learning curve is so great you have to truly want to learn Scala, whereas with something like Go you can just fart code out in a short period of time.

Reasons to learn Scala

  1. It fits a project you are doing
  2. YOur company uses it
  3. Because you want to learn a ton about programming theory and concepts and improve your skills
  4. Because you get bored easy and need a challenge.
  5. Because your college uses it.

Another reason will be to build apps based on the API of the app I release later this year. I plan to release a partial app written in Scala/Play framework after app launch. I’ll add lots of comments to the code and document it to help new people understand concepts of Scala that are hard to get clear at first. I am one of those people that like to know why, not just how, so I dig more than many people.

Follow me on twitter for more info. I hope to launch in the next 4 to 6 weeks.

Yes,It’s. I’m a beginner and i think scala is simple and it’s not diffcult to getting Started . But it’s not easy,and scala 's type system is diffcult to learn.

1 Like

I read your reasons why you should learn Scala and now I want to jump out a window and slit my wrist on the way down. I basically just randomly picked Scala out of a hat. I googled top programming languages, and said pick one blindly and learn that language. I didn’t see blindly pick a language as one of your reasons to learn Scala, now I am depressed. Just kidding. I did pick it blindly, but I am learning it and its been fun and frustrating.

2 Likes