Skip to content

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

Open
@nickperkinslondon

Description

@nickperkinslondon

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions