Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcard/Magical imports leave the reader guessing where a name comes from #710

Open
nickperkinslondon opened this issue Mar 6, 2017 · 2 comments

Comments

@nickperkinslondon
Copy link

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?

@process-bot
Copy link

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.

@MatthewCroughan
Copy link

I just ran into this again here #883

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants