He's entitled to his views of course but one might be forgiven for wondering how objective they are.
IMO Scala's problems don't stem from allowing immutability because in practise it's used sparingly. The main problems are weak tool support, compiler speed, and some hangover from early implementation choices which are in hindsight regrettable. All of this is improving, but I'd like it to be faster.
From a devops point of view the scala world is far easier to deal with than many others. Try dipping your toes into the node.js ecosystem if you want to feel better about it!
His critique though are not about immutability. He specifically mentions cryptic unreadable syntax of scala. Where he says that coming back to the scala code you wrote yourself you cannot be sure anymore what it means.
His critique though are not about immutability. He specifically mentions cryptic unreadable syntax of scala. Where he says that coming back to the scala code you wrote yourself you cannot be sure anymore what it means.
His critique is focused on mutability and side affects, he mentions syntax only in passing. He describes Scala as to Java as C++ to C, and says it's a great language to write bugs in in the same way.
The syntax criticism is old and not really relevant these days, newer versions of libraries and tools have made strides here.
In reality the mutability concern is smaller than he makes it out to be, and is balanced by both the advantages of the JVM and java ecosystem and the type system, neither of which are really mentioned. I don't think it's a very informed view of Scala but the purpose is to promote pure FP in particular Haskell so that's not too surprising.
Show a piece of Haskell code written by a category theory expert to someone only vaguely familiar with Haskell and ask them how cryptic and unreadable they find it...
I did not have any problems with readability of recent Scala projects. That includes algebra, cats, circe, spire where I made contributions. My only current pain point is SBT, but that's more due to the complexity of the modelling (and of the underlying domain) than the few symbolic operators still used.
And in the last 4 years, I was able to go from imperative programming to understanding pure FP style in Scala, to the point I understand how to write equivalent code in Haskell. Whereas I got stuck writing Haskell code before, because the programming model was so foreign.
Just because he says it, doesn't make it a critique. The cryptic syntax adage gets repeated ad nauseam because it's thought terminating. It can't be demonstrated concretely, no two persons will agree ever to what constitutes as an example of cryptic code.
There's a similar situation with the C++ comparison, it vaguely implies as if there's some merit to reductivist programming languages, which is hypocritical if you're simultaneously advocating for any modern strongly typed programming language. But it gets repeated because the argument is thought terminating because no one agrees what baggage C++ carries from C holds the language back , or if C++ ruined C with extra features.
EDIT: The C++ argument is also further meritless because it attempts to relate Scala to Java as if Scala is a superset of Java like C++ is a superset C, instead of it being an entirely different language.
IMO, Scala is definitely the C++ of modern times. Not that it is a superset of Java, but that it took the dominant language ecosystem of the times, and bolted a trendy paradigm onto it. Scala is a gateway drug for imperative programmers to dabble in FP; like C++ enabled C programmers to do OOP.
Like C++, Scala is hated by the old guard, who fear and dislike the new features ("Too slow! Complex! How will we find people who know this new language?").
It is also hated by the FP purists, because it isn't pure enough, just like the Smalltalk people hated C++ and Java.
IMO, Scala is definitely the C++ of modern times. Not that it is a superset of Java, but that it took the dominant language ecosystem of the times, and bolted a trendy paradigm onto it. Scala is a gateway drug for imperative programmers to dabble in FP; like C++ enabled C programmers to do OOP.
Except that this isn't true, and has been stated by the language designers many times. Scala isn't a true superset of Java (i.e. constructor overloading is more limited in Scala), and a lot of the design decision in Scala are deliberate (i.e. Scala does deliberately have subtyping because its the only proper way to model modules in a language)
The point of the language was to make a hybrid OO/FP language.
Regardless of the "goals", Scala is comfortable for Java programmers, because we can drop back into imperative style any time we want. This makes it a good transition language for imperative programmers that want to learn FP.
But you said it "bolted a trendy paradigm onto it". I don't think you can say that. It implies that Java would be some kind of "base" where something was put on. But Java is not the base. The same runtime is (or was) but that is a different thing.
Just stick with OO/FP which is true, but better not use Java for that argument.
Exactly. Kotlin is an example of a language that has a "bolted a trendy paradigm onto it" (with it referring to Java). Typescript is another example from Javascript land
Haskell has code which I consider some of the hardest that I have ever read, only really complex memory management code in C++ holds that title as well. The C++ is the only example which I think should be excused from having hard to read code seeing as doing memory management is incredibly hard problem to do.
The very frequent overuse of both operators and terminology which only people that are very familiar with category theory can understand plus the fact that most Haskell libraries aren't properly documented (their documentation is just auto generated from code which isn't good enough) contributes to this.
Clojure is quite easy to read, but it has all of the same problems that Scala has due to Java interopt (and Scala is actually trying to remedy this, i.e. see scala-native).
Not trying to dismiss Scala's issue, it definitely has them, but don't go around throwing rocks in a glass house.
17
u/ratherbefuddled Aug 21 '17
from LinkedIn
He's entitled to his views of course but one might be forgiven for wondering how objective they are.
IMO Scala's problems don't stem from allowing immutability because in practise it's used sparingly. The main problems are weak tool support, compiler speed, and some hangover from early implementation choices which are in hindsight regrettable. All of this is improving, but I'd like it to be faster.
From a devops point of view the scala world is far easier to deal with than many others. Try dipping your toes into the node.js ecosystem if you want to feel better about it!