3 ms·
> 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 ca
by 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.
- kjeetgill 5y agoI mean me personally? I'm very boilerplate tolerant. I'm not a fan of Dependency Injection/Auto Wiring for similar reasons and I've never found wiring boilerplate to be too painful. In fact I'd love even more explicitness and manual wiring for almost everything like disk, network, or even clock access aka passing capabilities! Default params are generally fine since they're hidden on the implementation side but explicit if they vary at the caller site. And even dynamic dispatch I try to use carefully and sparingly. I just like really explicit programs.
- ernst_klim 5y ago> I'm not a fan of Dependency Injection/Auto Wiring for similar reasons I see. My point was that such things are pretty common in most contemporary languages and I don't see how Scala is special in this regard. Yes, unlike Go or Java, implicits are part of the language spec and not some metaprogramming magic on top of it, but I'm not sure it's a bad thing.