3 ms·
they're an afterthought which serve truly no purpose other than to be fancy via obfuscation?
by jjtheblunt 8y ago
they're an afterthought which serve truly no purpose other than to be fancy via obfuscation?
- YorkshireSeason 8y agoImplicits are not an afterthought, but a core feature that enables efficient context-dependent parameterisation. Implicits let you avoid a lot of boiler-plate. They are especially useful for well-structured ad-hoc polymorphism, quite like Haskell's type-classes, the predecessor and close relative of implicits. If you don't like implicits, simply don't use them. You can add a style checker to your build automation that finds and rejects the keyword "implicit" in your code. As to use of implicits in libraries, you are perfectly free to pass explicit arguments instead. Odersky has a couple of recent youtube videos where he explains implicits in detail.