Smell suggestion: import
in busines logic code
#30
Labels
suggestion of smell
Elixir-specific smells suggested by the community
import
in busines logic code
#30
Hi @lucasvegi!
Thanks for the repo and your work on Elixir Smells!
I think there is a somewhat of a rule of
don't use imports in business logic code
(please point me to where this is documented/discussed if I missed this already) in a lot of the codebases that I've been around. For good reason too, (in my opinion, this is subjective though) because it adds a lot of indirection/mental load to reading code. I prefer knowing exactly where a function is defined if possible (Foo.bar
) rather than trying to find wherebar
comes from and getting sad it's not in the file I'm working on.There is an interesting thread in EF that discusses it and this opinion echos what I have seen in practice: https://elixirforum.com/t/anyone-wish-we-could-import-the-basics-without-conflicts/50567/2
The gist of it is:
I'm not sure how the mechanism to suggest smells really is, so I'm just creating this issue to get the ball rolling.
Thanks again!
The text was updated successfully, but these errors were encountered: