by minebreaker · 1y ago · 0 comments
I'd say Java is a great production language, mostly because it's so simple that I don't need to "learn" it (when you know better than using madness like `==` or Serializable).
However Java has advantages too: the IDE support was miles better than Scala, build times were shorter, most frameworks were more mature and better supported and the language itself was much more stable.
There's beauty in simplicity, and Scala is the antithesis of that, it has not only the kitchen sink but the whole kitchen and some house attachments within it. I fell in love with Scala for a while, worked with it for a couple years, and absolutely hated it whenever I had to train someone new. Nowadays I simply refuse to work with it because I'm not willing to relearn all the stuff it needs to be productive.
Succintly put, exactly this.
Scala is as bad/good as lisp, and has the same challenges.
It's fun for a solo developer or very tiny close-knit team to do intellectually fun code pirouettes and stunts. Not in a negative way, that does bring satisfaction.
But throw it into a multi-dozen people codebase with many varying styles and soon enough nobody understands what's going on and it becomes a royal nightmare.
There's a lot of value in simplicity if you need to maintain that code over the years and many people.
The thing is that, equality is the difficult problem. "equals" in JVM languages has a lot of problems. Dynamic languages are much more horrible in this aspect. JavaScript `==` is much worse than Java. Python is guilty too in my view, for using `__eq__` method. The only language I know which solves the problem correctly is Haskell. (Or, `Eq` in Cats)
JavaScript has an entirely different level of issues, where at first glance it _looks_ like `==` works the way you'd expect, and the issues start cropping up when you accidentally rely on assumptions like equality being transitive. I agree that this is much worse than Java, but it doesn't change the fact that Java still doesn't strike me as the simple, straightforward language you tout it to be. I'd argue that the measure of how simple it is to learn a language should be measured both by how quickly you run into behavior where you need to start caring about the underlying implementation and by how intuitive (or unintuitive) the underlying behavior you need to care about is. At least with regards to comparing equality, Python beats Java by that measure because it abstracts away the concerns about how to define equality from the concerns about how to actually perform the comparisons, and Java beats JavaScript because the extra knowledge you need to be able to compare equality correctly being way more straightforward.