3 ms·
Scala 2’s implicits have been a source of great pain in many Scala codebases at many different organizations. They are too powerful. The situation is comparable
by agrounds 3y ago
Scala 2’s implicits have been a source of great pain in many Scala codebases at many different organizations. They are too powerful. The situation is comparable to languages that depend on gotos instead of structured control flow elements (for/while loops, if statements, function/subroutine calls).
I can’t speak for Scala 3 as I haven’t used it at all. If they’ve limited the power of implicits to a few more structures usages it would be a great benefit to the language.
- _a_a_a_ 3y agoToo powerful? Or just ab/mis-used?
- sideeffffect 3y agoIn Scala 3, implicits live on under a different name. They're called _given_s. But they're reduced to just one use case: propagating a context through (and deriving one given form others). And Type Classes are subsumed under this use case. The other use cases have been essentially removed: * Extension methods are now its own feature, relying on completely different mechanism * Automatic conversions have been severely curbed and de-emphasized, although they are still there, but much more explicit