How about Go's... error on unused imports?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Thu Nov 12 18:55:19 PST 2009
Justin Johansson wrote:
> Leandro Lucarella Wrote:
>
>> I'm sorry to bring up another "How about Go's ..." topic, but I think this
>> feature is very in sync with D and it should be really easy to implement.
>>
>> Go issues an error if you have an import that's never used, to avoid
>> unnecessary dependencies.
>>
>> Do you see any reasons not to do that? I think it happens very often to
>> stop using some import and never notice it.
>>
>
> In my opinion, this is a very good idea. I continually remove imports
> when I think they might not be used anymore. Sometimes I'm right
> and sometimes I'm wrong and the compiler tells me accordingly. It
> would be nice to have a warning for unused imports to save the tedium
> of a redo.
>
> From a code understanding point of view it helps not to be obfusticated
> by unused imports.
>
> beers Leandro for picking this up,
>
> Justin
I think this is an environment issue. I like Eclipse's approach. Java
unnecessary imports are underlined with a wavy red line.
Andrei
More information about the Digitalmars-d
mailing list