Live data from Hacker News

Is it prudent to use Scala for anything new?

news.ycombinator.com

1–10 of 11 posts

Is it prudent to use Scala for anything new?

#1
Is it worth using Scala for new projects that don't use Spark? There seems to be a trend to not use Scala for anything new and either use Kotlin for functional programming or use Go where parallaisation is required. PySpark is popular among Spark folks. So, is it worth building anything new in Scala?

Re: Is it prudent to use Scala for anything new?

#2
Personally I am not a fan of Scala. There was the time I spent two days debugging something that used Scala actors to parallelize a calculation that: (1) got only a 2x speed up on an 8 core machine and (2) didn’t get the same result every time that we ran it.

It was a 20 minute job to rewrite in Java with an executor and it got (1) a 7.5x speed up and (2) the right answer.

In other cases it was human factors like the engineering manager who told me how great it was to handle errors with monads instead of exceptions except that they never actually handled the errors. This place claimed to be doing “functional programming” but they also claimed to be doing “code reviews” but if that were really the case that eng manager would have known that policies weren’t being followed (e.g. allegedly we writing unit tests but it was few and far between.)

Personally I thin Java is going in the right direction through JDK 8, JDK 17 and now JDK 21. If anything, Java is adopting “ML the good parts.” with pattern matching, sealed classes and such.

Re: Is it prudent to use Scala for anything new?

#8
I love scala, much better than java, tho java does steal features from scala.

You can express yourself in much less code and safer.

I do use it profesionaly for past maybe 8 years, mostly backend services.

Anyway kotlin is probably also better than java.

Re: Is it prudent to use Scala for anything new?

#9

Personally I am not a fan of Scala. There was the time I spent two days debugging something that used Scala actors to parallelize a calculation that: (1) got only a 2x speed up on an 8 core machine and (2) didn’t get the same result every time that we ran it. It was a 20 minute job to rewrite in Java with an executor and it got (1) a 7.5x speed up and (2) the right answer. In other cases it was human factors like the…

It seems that you struggled with an actor lib (edit: and with your company), not really with the language itself.
Post reply on HN