Nested public imports - bug or feature?

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 13 10:17:41 PDT 2015


On Thursday, 13 August 2015 at 17:09:11 UTC, Dicebot wrote:
> On Thursday, 13 August 2015 at 17:06:18 UTC, Jonathan M Davis 
> wrote:
>>> Matter of scale. At some point of application size 
>>> maintenance cost become much higher than development costs - 
>>> and problems of name clashes become more important than any 
>>> extra typing annoyance.
>>
>> Well, if name clashes become that high in a .cpp file, odds 
>> are that it's pulling in too much stuff.
>
> My projects have been broken twice by adding new functions to 
> druntime (and one was symbol added to object.di :)). Forgive me 
> if I discard that argument as nonsense. If short names are 
> allowed and project is big enough, clashes are simply 
> inevitable. With D module system even medium size will do.

Yes. Clashes are going to happen, especially if you're using 
short names heavily, but in C++, I've rarely had problems with 
it. D is potentially worse, because we don't have the equivalent 
separation of header and source files where it's only the source 
files that risk breakage. But still, I'd _much_ rather just deal 
with the occasional breakage than have to qualify everything.

- Jonathan M Davis


More information about the Digitalmars-d mailing list