How about Go's... error on unused imports?

Walter Bright newshound1 at digitalmars.com
Mon Nov 16 01:57:37 PST 2009


Leandro Lucarella wrote:
> Walter Bright, el 12 de noviembre a las 19:35 me escribiste:
>> Andrei Alexandrescu wrote:
>>> I think this is an environment issue. I like Eclipse's approach.
>>> Java unnecessary imports are underlined with a wavy red line.
>> I agree. I would find it very annoying to have to remove unused
>> imports to get it to compiler. First off, I tend to have "all"
>> imports that import everything.
> 
> That's odd, first you say you think D would be a failure if it needs an
> IDE and now you say that the only way to avoid unnecessary dependencies
> you should rely on an IDE =)

It's not a problem that needs fixing. It's not a bug, it's a stylistic 
issue. IDEs are good for that.


> I really think this should be a compiler feature. Make it a warning then
> (and while you are at it, make it a *real* warning, not a warning-error).
> 
>> Secondly, what if I version out some code, wouldn't want to version the
>> import too.
> 
> Why?

Because I often block out and unblock out code during development. 
Having to go up and dink with the imports too would be quite annoying.

At some point, adding too much of this nagging stuff into a language 
will drive people away.



More information about the Digitalmars-d mailing list