3 ms·
Implicits are very powerful when used correctly, but are terrible if not.
by Cyph0n 9y ago
Implicits are very powerful when used correctly, but are terrible if not.
- MrBuddyCasino 9y agoIf "<feature> is very powerful when used correctly, but terrible if not": think long and hard before adding to a language.
- lmm 9y agoCompletely agreed. Implicits are the one place where Scala genuinely pushes the art of language design a bit beyond what's really possible; I expect future languages to come up with a better solution to the same problem. But in the meantime the things they enable - typeclasses, extension methods, the magnet pattern - are too valuable to do without, and we can't just sit around and wait for the perfect language to arrive. I wouldn't want to have any more language features that pushed as hard as implicits do, but one somewhat-experimental feature in a language is ok, just about. I don't think Scala is a thousand-year language, but it strikes the best balance given the current state of the art.
- yawaramin 9y agoTypeclasses: barely workable–if the implementor knows how to save the caller from paying the 'import tax' Extension methods: too much potential for confusion Magnet pattern: no idea what that is Personally I feel OCaml strikes the best balance :-) But we may be arguing about an inch here rather than a mile.
- dionian 9y agowhich is why I'd be against adding them in Java and favor keeping the power in scala.