News for hackers. Stuff that matters.
Re:Java's records, Lombok's data, and Kotlin's data classes by ernst_klim on Friday May 07, 2021 @04:18PM (#27080403)
> 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.

Re:Java's records, Lombok's data, and Kotlin's data classes by kjeetgill on Friday May 07, 2021 @05:17PM (#27080941)
I 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.

Re:Java's records, Lombok's data, and Kotlin's data classes by valenterry on Friday May 07, 2021 @09:05PM (#27082654)
I 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).

Re:Java's records, Lombok's data, and Kotlin's data classes by ernst_klim on Saturday May 08, 2021 @02:20PM (#27089516)
> 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.

Re:Java's records, Lombok's data, and Kotlin's data classes by kjeetgill on Sunday May 09, 2021 @04:12AM (#27094201)
I 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.

Re:Java's records, Lombok's data, and Kotlin's data classes by ernst_klim on Sunday May 09, 2021 @07:05AM (#27095020)
> 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.