Spurious imports in Phobos ?
Somedude
lovelydear at mailmetrash.com
Wed Nov 9 23:57:59 PST 2011
Le 09/11/2011 14:15, Trass3r a écrit :
>> 2. what is your opinion about public import ? In C++, "hidden" or
>> "implicit" #includes is a common source of compilation problems (order
>> of #includes), I tend to think it's a bad thing.
>
> It can be quite useful. I use it often for C library wrappers. As soon
> as you import the wrapper code you automatically import the bindings to
> be able to use constants etc.
I agree it's useful in this special case, but in the general case, I
think it encourages sloppy programming: it binds modules together more
than necessary, and it seems that once public import is used, it can be
very hard to remove it afterward.
More information about the Digitalmars-d-learn
mailing list