Beta 2.079.0

psychotyicRabbit meagain at meagain.com
Fri Feb 23 02:20:41 UTC 2018


On Friday, 23 February 2018 at 01:57:37 UTC, Martin Nowak wrote:
> On Thursday, 22 February 2018 at 11:15:35 UTC, psychoticRabbit 
> wrote:
>> import std.rabbit [food, water], std.house, std.family [carer];
>
> What about the million lines of existing code using
>
> import std.stdio : writeln, writefln;

I actually like selective importing like that.

It tells me, the programmer was only interested in writeln and 
writefln from that module. It provides clarity of intention, as 
well as instructing new comers what modules contain, and where to 
find them.

Selective importing is a great tool for new comers to become 
familiar with the library - and lets be honest - it's all about 
the libraries these days - so the more one knows about them, the 
better they'll be utilised.

Also, D is pretty good a depracating stuff, so why not deprecate 
the current way of imports, and gradually move to something (that 
resolves issues):

e.g.

import std.stdio, std.whatever[this, that], std.somethingelse, 
std.grr[wtf];

I actually really like that syntax. It's really efficient for my 
brain to process.



More information about the Digitalmars-d-announce mailing list