Windows console is broken

Bill Baxter dnewsgroup at billbaxter.com
Fri Feb 1 12:16:15 PST 2008


bearophile wrote:
> Sergey Gromov:
>> It's a module, it works fine, why bother ?  Anyway, if I were to do
>> something about it, I'd prefer to static import them and use full
>> names in the code.  What you've proposed looks to me like
>> a real mess.
> 
> It's way better than having all those names and many more other in the namespace, plus not knowing where they come from. So I think you are wrong.
> 
> Bye,
> bearophile

For modules you plan to use heavily, renamed import is the way to go if 
you want to keep your namespace tidy, but don't want to type crazy long 
FQN identifiers.

import IO = std.stdio;
import Fmt = std.format;

That plus judicious use of selectivly imported symbol like bearophile 
mentioned, makes keeping your namespaces clean not so painful.

I think python's a little different though in that there is no real 
"private".  A language with a public-everything philosophy really needs 
to watch out for namespace pollution.

--bb



More information about the Digitalmars-d mailing list