> 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!
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.