5 ms·
Scala has to the solution to every problem except the problem of too many features.
by aero142 5y ago
Scala has to the solution to every problem except the problem of too many features.
- AzzieElbab 5y agoMaybe but scalas case classes are super easy to grasp and require no magic like annotations
- xenomachina 5y agoWhat annotations are you referring to?
- scubbo 5y agoI'm not the person you were asking, but, presumably, Lombok's annotations.
- AzzieElbab 5y agoLomboks. Seriously, scala case classes are like the very first thing people start using when learning the language. Scala3 enums are even more straightforward
- xenomachina 5y agoThe ancestors of your comment mention Kotlin, not Lombok, which is why I asked. Kotlin's data classes are probably the analog to Scala's case classes, and they do not require annotations.
- ernst_klim 5y ago> except the problem of too many features Scala is a pretty simple, concise and coherent language though. Never understood why people deem it has too many features, I write it professionally and never felt so. At least comparing it to C, C++, Python. Java may be more simple, but you have tons of features added with metaprogramming via dozens of annotations generating lots and lots of boilerplate, Lombok and Spring are examples of that.
- kerblang 5y ago> Never understood why people deem it has too many features I'll start with one (key)word: `implicit` I agree with your distaste for metaprogramming though.
- ernst_klim 5y ago> I'll start with one (key)word: `implicit` I don't think implicit counts as "too many features" or as something complex. Basically all it does is finding a canonical value in scope for a hole of certain type.
- kjeetgill 5y agoI only worked in Scala briefly so maybe it's coming from Java habits, but implicits were huge pain. When first reading through code you don't really know if that function call you eyed over really has the params you think it does. It makes it WAY harder to track what's derived from what. Either way, the local Scala guru there said the Scala community was starting to get over implicits.
- valenterry 5y agoI think that's were it comes from: people that briefly worked with Scala in the past. At some point it was true, but nowadays the problem is solved because IDEs will show you were an implicit is used and where it comes from. Without that, it was indeed more difficult - but also not more difficult than Java's reflection or DI (where you had and have even less help).
- ernst_klim 5y ago> When first reading through code you don't really know if that function call you eyed over really has the params you think it does. Yeah, but don't you feel the same pain when using Spring's autowiring? Or python's (or C++ template) default arguments? Or dynamic method dispatching in any OO language, where you don't know what method you actually call? Or late bindings? I don't see how implicits' implicitness is significantly worse than any other kind of implicitness common in other language.