the point of selective importing

Regan Heath regan at netwin.co.nz
Tue Jul 11 06:07:31 PDT 2006


On Wed, 12 Jul 2006 01:03:16 +1200, Regan Heath <regan at netwin.co.nz> wrote:
> On Tue, 11 Jul 2006 15:56:44 +0300, Georg Wrede <georg.wrede at nospam.org>  
> wrote:
>> Bill Baxter wrote:
>>
>>> static import module.with.a.long.name.string;
>>> alias module.with.a.long.name.string Str;
>>
>> import module.with.a.long.name.string as Str;
>>
>> This keeps "Str" and the module name and the word import on one line,  
>> making it hugely easier to grep for them.
>
> Assuming the coder wasn't a 'half sane monkey on crack' you should be  
> able to open the file in an editor, go to the top and do a search/find  
> on "Str", the first result should find it. Anything else is either bad  
> programming practice or a moderately rare case where 2 things include  
> each other and so one uses the other before it's declaration.

In fact a good UI should be able to take you to the declaration of a  
symbol with the press of a single button, like F12 in developer studio  
does when you have browse info enabled.

Regan



More information about the Digitalmars-d mailing list