elm-lang.org
elm-lang.org copied to clipboard
Wildcard/Magical imports leave the reader guessing where a name comes from
As an Elm learner, I often get frustrated while reading elm code by not knowing which module a name comes from. This is because of the use of "wildcard" imports/exports. If names are not explicitly listed in the imports, the human reader of the Elm code does not know which module a name comes from, and is left guessing! ( the compiler knows, but the human does not )
These types of imports have been available in other languages, too, but I think they are generally frowned upon, aren't they? It almost seems like Elm has adopted the wildcard-import as a normal thing. Where will this leave us when programs get bigger and bigger?
It's great that Elm can magically infer the types of things -- that's cool. It's not so great that Elm magically infers the module from which a name is imported. That is just making it harder for me to read. What lessons can be learned from other languages here? Is it too late to require all names to be explicitly imported?
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
I just ran into this again here https://github.com/elm/elm-lang.org/issues/883