Arbitrary abbreviations in phobos considered ridiculous

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Mar 9 20:56:12 PST 2012


On 3/9/12 4:59 PM, Steven Schveighoffer wrote:
> I don't think we should make the default the most conflicting or
> difficult to use method. For example, to say:
>
> "always import log using:
>
> import log = std.log"
>
> Is not as good as just not having to say that (i.e. import std.log like
> you would any other module). I remember Tango had a couple of modules
> like that, and I thought it was pretty confusing.
>
> That doesn't mean you can't utilize those facilities (and I *don't*
> discourage them). I just don't think it should be a barrier to usage.

Yah, I'm a bit "ehm" about the sudden recommendation to use named 
import, too. However, I've been "ehm" about similar things in the past 
and came to figure that some things are just useful idioms in the 
forming (e.g. returning locally-defined structs).

I find "import log = std.log" better and using the language more 
naturally than the alternative - a struct/class in conjunction with the 
"stuttering" convention std.log.log.


Andrei


More information about the Digitalmars-d mailing list