Hacker News new | more | comments | ask | show | jobs | submit login
Ask HN: Should I be learning Scala in 2019?
32 points by TG94 27 days ago | hide | past | web | favorite | 40 comments
So, I'm mostly a .NET and Node.js guy (with front-end experience as well). I wanted to branch into the Java ecosystem but having prior experience in Java, I was not a fan of the syntax.

I have heard a lot about Scala and I decided to jump into that (without enough research). I got a Scala book and I'm about a 100 pages in and I must say I do like the language, its seems very interesting and productive to me thus far. However I decided to google about language usage, future and jobs.

The results weren't very motivating and now I'm doubting whether I should keep going? Are companies choosing Scala nowadays for new projects? (not talking about legacy systems)

I love scala, it’s probably my favorite language. It’s one of the most flexible and powerful languages I’ve ever come across. The downside of this is that it very complicated, I wouldn’t consider myself anywhere close to an expert even after developing with it professionally over 5 years.

In regards to new projects, I do believe people are using it for new stuff. Both Spark and Akka are very powerful libraries that have little parallel in other languages.

Imo, Scala is the most advanced language on the jvm, far outclassing Kotlin, Clojure, and Java in terms of expressiveness.

I would recommend learning it and playing around with Spark. I think the combination is very employable.

Also, Scala is so much fun! I love it!

> Imo, Scala is the most advanced language on the jvm, far outclassing Kotlin, Clojure, and Java in terms of expressiveness.

Exactly why I don’t want any new scala code on my team. We don’t need engineers spending three days arguing about pedantic differences in the language because something can be done 8 different ways. And who wants to maintain something in scala that they didn’t write? It’s a nightmare.

I mean, as long as everyone agrees to use purely functional constructs and heavy use of monadic intetfaces, I haven’t found it a problem. Without mutability and with referential transparency for all structures, I think it’s fine.

The problem is when you have a Java guy on the team who writes crap OO code. That’s when it becomes impossible to reason about. We had a rule on my last scala dev team that if you wanted to use a var or a structure from collection.mutable, you had to give a presentation on why it was necessary.

That sounds a bit reductionist, as if 'heavy use of monadic interfaces' would be kind of a silver bullet. There's a lot of concepts to internalize before being able to build large scale systems using categorical abstractions: Monads, monad transformers, free monads, applicatives, arrows, ...

When to choose what? Probably leave the choice to library-implementors mostly. Still, should the bar to implement a library be set so high? The middle ground seems to be what e.g. Rust is doing. No explicit categorical types, use functions where functions make sense, i.e. for most stuff that isn't I/O.

Certainly monads, semigroups, etc etc aren’t the silver bullet a lot of people think they are. But it is amazing how many forms of computation can be formalized into these structures. Of course, just because you can doesn’t mean you should. A lot of times it just makes things more complicated for no benefit (a lot of IO monads fall into this category I think).

But there is a big benefit to using these category structure: you don’t have to think as hard about the underlying implementation because you know it must obey certain laws. Also category theory interfaces tend to be pretty simple and easy to learn: most of are defined by a couple functions and a couple laws.

Everyone knows how to map or flatMap, and that’s really all you need in a lot of code!

> And who wants to maintain something in scala that they didn’t write?

I do, just joined a Scala team and i am maintaining multiple services and writing my own.

Akka.net is rather good.. Also akka is heavily inspired by the core facets of Erlangs actor model. It is certainly a parallel if not more.

This link compares search volume for Scala, Rust, and Kotlin for past 12 months in U.S.


(Scala wins by a large margin!)

Awhile ago I chose Scala for a multi-year side project. I love writing Scala. I think the Scala community is quietly productive and mostly talks to themselves.

I'm not a Scala expert by any means, but I have have been programming for awhile and appreciate the power and terseness that comes out of my Scala code. It feels like I have more time to design well because I needn't write so much code :P.

Going to attempt a good/bad/ugly for Scala...

Good: - Scala ecosystem very much under active development. Scala 3.0, compilation speed improvements, popular libraries updated regularly, IDE integration (VSC is recommended right now I think) - Powerful. Scala's type system is relatively advanced. If used properly I think this can reduce bugs and cost of maintenance and new features. - Fast and portable. jvm!

Bad: - Scala's relatively slow compilation reduces cycle time, but I find often this is mitigated by confidence in the code I'm writing, so I don't often need to stop and run it to ensure correctness. - Very high learning curve to wield the power effectively. Scala is an ecosystem that demands commitment. For example, sometimes I feel like I'm missing the requisite PhD to get the sbt build tool working properly.

Ugly: - Due to Scala's power and high learning curve, a few failure modes may occur that make Scala impractical for many real-world software teams: Scala/functional experts can write a "Russian doll" of abstractions that's hard for someone less experienced to decipher, code review, or maintain; new team members who are also new to Scala/functional may have to ramp up with both business/codebase and functional concepts; and Scala gives you so many different "ways" to solve the same problem that code styles may diverge even in a small team, increasing cost and risk.

Overall I really love Scala, am looking forward to Scala 3.0, and intend to use it for many years, especially for projects with small, experienced teams where Scala's power and learning curve is an asset and not a liability.

One the things I really don’t like about Scala is yet-another-obscure-build system.

I’m forced to use sbt and I don’t like it. And from my reading of my Scala book, the scala compiler is running in some kind of daemon or server instead of a stand-alone compile?

I hate it when so much stuff happens in the background and you can’t figure out what it is.

I’m forced to use abt and I don’t like it.

You don't have to use SBT. Maven works fine with Scala and is quite mainstream.

You're not forced to use sbt, it just happened that sbt is the fastest/most reliable way to compile scala code. Maven can compile scala just fine, albeit a little bit slower since it has to spawn a new instance of scala compiler each time.

The scala compiler is stand-alone, all deamon/server implementations are just workaround to speed up build for any build systems other than sbt.

Just for comparison... see the same query, with Go and JavaScript added in.


I'd like to learn Scala too. At the moment it's definitely not as prevalent as other languages, but it's higher than emerging languages, which I think was @spir's goal.

I didn't add this to invalidate the parent comment; just to add another view.

I lead a team who rewrote their stack from C#/C++/Win to Java/C++/Node.

Big wins were being able to leverage the much larger ecosystem, and containerization.

We played with Scala but it didn’t work for our team, the expressivity is a two edged sword. Runtime is absolutely fine though it was all about complexity, and poor developer tooling. And since we are in a smaller market, not SV, sticking to platforms where we can find hires was probably a better call for our company.

What big win did you get from moving from C# to Java that you wouldn’t get just from moving to .Net Core?

Cheap coders?

It seems like it. If there only goal was to move from Windows, they spent a lot of money rewriting their whole stack instead of just migrating to .Net Core.

My answer is Yes. There is still a lot of momentum behind Scala. It's pure functional structures are way more mature than Java's. The most common complaints against Scala are build tools and compiler. A great team is working on it as we speak.

Scala also forces you to think differently.

> I wanted to branch into the Java ecosystem but having prior experience in Java, I was not a fan of the syntax.

Independent of the question around Scala: If you want to get into the JVM ecosystem, you should also be able to understand and write Java. Some dependencies will not be available natively in a secondary language like Scala. And it will also give a better understanding about the limitations of the underlying platform.

This. Almost all libraries and their example/documentations will be written in Java, so you have to learn Java if you want to use other language in the JVM.

Even if you end up not using it for anything in production, it is always worthwhile to learn new programming languages, how they approach solving problems and structuring programs.

It opens our mind to new ways to architecture our software.

Assuming that you don’t have other obligations like family, hobbies, etc.

I specifically optimize the limited amount of free time I have to devote to career self improvement to what is going to help me be more competitive in the job market.

Having the skills of being able to bring new ideas into existing software stacks, without forcing the business to lose money with yet another rewrite of the month, is exactly one way of being more competitive in the job market.

For example, if I wanted to bring the ideas of functional programming to a C# shop, why not just learn the concepts of functional programming in C#?

On top of that, if there is a standard way to structure a program in a given language, you’re not doing future developers and maintainers any favors by not following the paradigms of that language or “you can write COBOL in any language”.

When I’m writing on Python, I try to do things in the “Pythonic” way. The same with JS or C#.

Lets take Python as example.

async/await only came to it after the success it had on .NET.

So one could have toyed with async/await in C#, and now already understand some best practices to apply in Python.

Or read the Osaki's book on persistent data structures and implement similar ones in a Python library for concurrent code in Python.

Or maybe one has spent a couple of days learning about OCaml and Haskell, and is in a better position to understand how to make better use of list and generator comprehensions or itertools package.

Of course one also has the choice of only eating what is on the plate, without understanding the variations that the same ingredients allow for.

The question is, who has the time?

I already have a two to three year agenda to improve up the stack ($cool_kids_front_end framework of the week), down the stack (AWS cloud infrastructure from a developer, infrastructure, devops viewpoint), more breadth at certain levels (get better at Python, big data, ElasticSearch and Kibana) and staying fluent when it comes to architecture (scalability, high availability, security, etc). Why would I take the time that doesn’t help in that goal?

I don’t need to be an expert in all of those areas, but I at least need to be good at some, average at some, and be conversant in other areas to at least know the what if I don’t know the how to be able to command higher than market salaries as either “adult supervision” at smaller companies or an overpriced consultant - and I am not talking about Silicon Valley/West coast salaries.

Anyone that has an employer that allows setting learning goals as part of the evaluation process.

I agree and my company does the only two things in support of my learning goals that I could expect. They will let me work on a project using technology that they know I’m not the most experienced with to give me the chance to learn it instead of siloing me on just my area expertise and they reimburse me for AWS certifications. Both of which at the end of the day help them out.

I wouldn’t expect them to let me spend time on the clock to learn Haskell or Rust when we are a C#/JavaScript/Python shop or to learn the ins and outs of Azure since we are an AWS shop.

Faire enough, on my case I am free to spend the time on any technology, provided it is agreed upon and I happen to do an session to the team afterwards.

So lets not generalize if it is a waste of time to the OP to learn Scala.

What’s your end result? If you are focused on career based learning, there are a lot more jobs out there for pure Java development and Kotlin is picking up serious steam especially when it comes to Android development.

Besides if you already a .Net developer, you’re probably already using JetBrains R#. They are behind Kotlin and the best IDE for it.

I’m also not a Java fan for a lot of reasons but the syntax of Java is not that far from C# that I could see liking one and hating the other.

If you only care about marketability on the backend side, then scala is certainly a fair choice. The difficulty with scala is the complexity of the language itself.

If you want to improve your own thought process rather than your skill in just one programming language, then clojure(script) would be a better choice. Once you've been through the learning and practice curve, the benefits of having decomplected your mind will spill to other languages.

Here in the UK and London demand for Scala is very close to the demand for Ruby. If you search Indeed.co.uk by title there are around 162 jobs each for Scala and Ruby in the UK, with 65 for Go. Scala's other rival is non-Android Kotlin which has only recently edged into double figures.

If you want to branch into Java, learn Java.

More importantly, why do you want to branch into Java specifically? Is there a company/job you have your eye on? Or do you want to get into web dev backend?

Because there are so many, many languages/technologies out there, asking "should I learn X?", the answer is always "if you like it or it'll get you a job you want, yes"

I think it is worth it to learn the functional aspects. Depending on other things you would want to explore there are some great libraries - Building reactive systems with Akka or data analysis/pipelines with Spark. I would suggest looking at a few books to get going with Scala as online resources aren't great.

- Functional Programming in Scala

- Akka In Action

Scala is good, but I haven't seen it being used as much as it was popular a few years ago. It may die with a handful of loyal users, sadly; I bought the new Scala book myself and it's gathering dust.

You may want to check out F# if you're looking for a .Net functional language. Or try out Haskell.

As everything: that depends. In general it's a good mindset change after .NET (well, unless you're doing F#) so it both grows your ways of thinking and your repertoire. If you have limited time to learn and you're doing it for a new job, the equation might be different.

You should be learning how to answer these questions yourself. Part of growing up as a programmer is being able to answer. What language should I learn, what framework/library should I learn, what project should I work on. Everyone is different, with different background and goals. You must learn to figure out where you are and where you're going and then answer the question for yourself. There has never been a better time to learn Scala for at least one programmer out there and at the same time, it could be the worst mistake another could make right now.

In my opinion, your criticism is unwarranted here. Asking about the job market for a language on HN is completely valid and doesn’t signal an inability for OP to answer the question on their own.

If the goal is access to a wider job market then learn regular Java. It's the most popular JVM lang now and likely to remain so for decades.

Try Kotlin

which book did you get?

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact