2 ms·
`conn` is a magic argument isn't it? Like an implicit argument to this block of code? That is one thing that really bugs me, is I can't automatically see where
by no_wizard 3y ago
`conn` is a magic argument isn't it? Like an implicit argument to this block of code?
That is one thing that really bugs me, is I can't automatically see where the arguments are coming from. I realize it makes code a little more verbose, but a requirement around explicitly showing the dependencies used is much more useful when you're refactoring, for instance, or scaling code.
not a hard requirement by any means, sure, and it definitely doesn't mean something won't scale as it were, however I am constantly frustrated by languages that allow for implicit scoped dependencies / arguments.
- halostatue 3y agoYes, it’s a bit of a magic argument, but it’s the only unhygienic variable introduced with a Plug dispatch: https://github.com/elixir-plug/plug/blob/main/lib/plug/router.ex#L582-L589 https://github.com/elixir-plug/plug/blob/main/lib/plug/route... Everything else is explicitly passed, AFAICT.