3 ms·
> Implicit parameters are one of my favorite features of the language. The real question is: does the team you work with share your love of implicits? Implici
by hota_mazi 9y ago
> Implicit parameters are one of my favorite features of the language.
The real question is: does the team you work with share your love of implicits?
Implicits are fun to use but they lead to code that's very hard to follow, so it's not uncommon to come across people who love them but these same people don't always realize the kind of code they are writing until way later.
- doikor 9y agoThere is some learning curve for people not familiar with Scala (not enough Scala developers in the market here so we have to "train" new developers often) But in general I haven't heard that many complaints outside of the few places where we use them for type level programming (Shapeless. Where most of the complaints are related to compile times). But the goal is usually to hide this behind some library or easy to understand type class instance and using implicits and shapeless to automatically derive the instances. In general all the type class based stuff relies on implicits to be really useful and haven't really heard any complaints related to that pattern from anyone once they actually understand what type classes are and what they are used for. Almost all the other use we have for implicits is automatically passing some context around in the app. This is things like RequestContext traveling down through the app and transmitting it to the next service in the chain. Basically only used so you don't have to be manually passing it around all the time. (another common example of this is passing ExecutionContext around. Or the ctx: Context in scalac that Martin mentions which appears 2600 times. If having it as implicit parameter 2600 times is pain think about having to manually fill it in) Implicits conversions is something we try to say away from if possible (there are some valid use cases for it but be careful with it)