In Scala it's bad practice to use implicit parameters for summoning traits that aren't type classes. Not all traits required via implicit parameters are type classes, usage via "implicit" isn't what defines a type class, the trait's signature is. Stop using "implicit" for DI.
-
Show this thread
-
A lot of the "tagless final" in Scala is basically "passing all OOP dependencies at the call site as implicit parameters", the so called "algebra", in this context a fancy term describing OOP classes w/ state. The things people do to avoid giving plain arguments to functions
4 replies 0 retweets 13 likesShow this thread -
Using implicits for DI is bad b/c reading code requires more context. It's why the Linux kernel has never adopted C++, b/c kernel devs want to reason about pieces of code in isolation, C making everything explicit. Reading code is more important than writing it, always.
2 replies 1 retweet 27 likesShow this thread -
Replying to @alexelcu
But shouldn't that be what context is? It's the things that the reader can take for granted, and every additional explicit parameter that ought to be taken for granted instead has to be present, diluting the parameters that are actually significant to the method.
2 replies 0 retweets 1 like
Reading code is more than being able to reason about fragments of it in isolation. That's important, of course, but unnecessary explicit parameters can also look a lot like boilerplate.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.