Andrei Alexandrescu Wrote: > 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
I don't like to engage in unnecessary debate but please consider: 1. the suggestion is for a warning message not an error (perhaps even enabled by a compiler switch or warning level), 2. by environment I presume you mean development system and/or editor. Sure Eclipse does okay with Java unused imports as you say. Now whist I use Eclipse with Descent plugin, relying on environment presupposes that environments support the feature. Descent currently does not; perhaps it will in the near future. It is fair conjecture though that widespead, mature support for D IDE-wise may well be sometime into the future. This is to say nothing for those that prefer to hack with command line tools and light-weight editors. So in summary, my humble opinion is that placing this responsibility onto the environment is both pie in the sky and passing the buck. Justin
