1. 6

  2. 4

    I’ve come to the conclusion that “Scala as a better Java” is misguided.

    First, if you’re wrangling with a legacy Java codebase, you should use Clojure. I’d prefer static typing for anything that can be designed from scratch from first principles, but when you’re wrangling unknown unknowns on a constant basis, dynamic typing pays off.

    Second, the only case where I see a benefit to using Java is when you need control over performance but want GC because you don’t trust the user code to manage memory. (For the record, high-performance Java looks a lot more like C than any high-level language.) In that case, you don’t just want “a JVM language”. You’re pretty much stuck using Java, then, as far as I can tell.

    Third, when you’re a cranky old conservative coder like me, you realize that the major service offered by high-level languages is what they protect you from, not what they enable programmers to do. Scala doesn’t protect you from Java horrors (null overuse, SingletonFactory patterns, ORMs, mediocre programmers) and brings additional complexity. The features often don’t work well together, and large Scala codebases are often messes with obnoxiously long compile times.