5 ms·
> Avoiding repetition with contextual parameters This is the type of stuff that made me go away from Scala. Why implement a feature that optimises for code wr
by sabellito 6y ago
> Avoiding repetition with contextual parameters
This is the type of stuff that made me go away from Scala.
Why implement a feature that optimises for code writing? How does my editor let me know that function receives that parameter without me going "???" and having to go into its definition?
Implicit conversions fall into the same category, of making code pretty to look at, quick to write, and a nightmare to understand when you're new to a codebase.
Shame, really. The good parts of Scala are wonderful.
- hocuspocus 6y ago> How does my editor let me know that function receives that parameter without me going "???" and having to go into its definition? IntelliJ has been able to do that for a while now. > Implicit conversions fall into the same category, of making code pretty to look at, quick to write, and a nightmare to understand when you're new to a codebase. Don't do it, and don't allow it in your codebase.
- sabellito 6y ago> IntelliJ has been able to do that for a while now. It has been 4 years since I did Scala everyday, back then it was hit or miss. Good to know things have improved. > Don't do it, and don't allow it in your codebase. I get your point, but that doesn't solve the issue if the community is down for using these features.
- hocuspocus 6y agoBoth JetBrains and the Scala center have invested in the tooling experience in the past 2-3 years, you should give it a try again! And I don't think I've encountered implicit conversions that often in the ecosystem.
- vvillena 6y agoThe community isn't very fond of implicit conversions. That's why you get warnings unless you enable a compiler flag, and why Scala 3 downgrades them from magic keyword definitions to avoidable stdlib types.
- lmm 6y agoIt's not meant to replace the stuff that you'd use a normal function call for, it's meant to replace the stuff that you'd do completely invisibly. Every real-world Java codebase ends up using massive amount of incomprehensible magic for e.g. DI, transaction management, web request mapping, serialisation. Every real-world Python/Ruby codebase ends up using magic proxies, metaclasses, method_missing or other such stuff. Scala is the only language where I've been able to find real, enterprise-scale codebases written in 100% plain old code without any AOP-style magic, because the implicits let the language be expressive enough that you can avoid those things without your business logic getting drowned in secondary concerns.