proposal: improved import declaration

Derek Parnell derek at nomail.afraid.org
Tue May 29 23:31:33 PDT 2007


On Tue, 29 May 2007 22:36:45 -0700, David B. Held wrote:

> eao197 wrote:
>> [...]
>> import tango.io.{Console, Conduit, FilePath, FileSystem, Stdout};
> 
> I like Java's syntax better:
> 
> import tango.io.*;
> 
> It's not as precise, but once you import more than two or three modules, 
> you might as well do the whole namespace.

One problem I have with importing things that you don't actually use, is
that it makes impact analysis a bit harder. In other words, if I change a
module, what other modules might be effected by that change? One way to
find out is to see which modules import the one you are planning to change.

To say "import whatever.*" doesn't help me know which module the importing
source actually uses. I know this is not an absolute or exact way of
knowing the impact but it goes a long way towards it.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Justice for David Hicks!"
30/05/2007 4:28:13 PM



More information about the Digitalmars-d mailing list