Why not std.io instead of std.stdio?

torhu no at spam.invalid
Sat Apr 25 11:53:28 PDT 2009


On 25.04.2009 19:41, bearophile wrote:
> I agree that std.io is better than std.stdio and I agree that a *bit* more hierarchical structure in Phobos can be good (but we have to avoid the silly deep nesting of Java libs), like adding one (1) more nesting level (only where it's actually useful and using the current flat structure anywhere possible):
> std.foo.bar.functionname
>

I don't mind, as long as it doesn't lead to having to use renamed 
imports to avoid long FQN, like in Tango.  Keeping fully qualified names 
short is nice in some cases, like when avoiding the conflict between 
std.date.toString and std.conv.toString.

The reason Java gets away with using many directory levels is that 
everything is inside a class, so there's always a single-level 'local 
namespace'.  It's almost always either ClassName.member or 
objectName.member.

> When you import it's generally better to qualify imports anyway, helping you to know where each name comes from:
> from std.foo: bar, Baz.

Yes, but selective imports often cause forward reference errors, so I've 
more or less stopped using them.  They also pollute the name space of 
modules importing modules that use them, which can be bad for libraries. 
  Of course, both issues are well known bugs.



More information about the Digitalmars-d mailing list