public import and bugs it causes

bearophile bearophileHUGS at lycos.com
Fri May 14 14:04:05 PDT 2010


Simen kjaeraas:
> In short: Public imports have their place, but don't use them
> if there's no need. (like with just about everything else)

OK :-) But I suggest to limit the usage of public imports to the minimum, just as casts. (I like to limit the public imports in my dlibs1 to the "all" module (the one that imports everything)). The problem with similar coding/idiom "suggestions" is that programmers often ignore them, even when there is "no need", as you say. I have seen D code with all kind of ugly things inside. This is why a bit of bondage is sometimes necessary for the less disciplined developers. It's a matter of balance.

Bye,
bearophile


More information about the Digitalmars-d mailing list