Nested public imports - bug or feature?

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 13 10:32:29 PDT 2015


On 13-Aug-2015 20:17, Jonathan M Davis wrote:
> 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 private symbols from imported modules *do* clash with public 
ones even though not accessible. THAT is the problem and header/source 
is not the reason of D doing worse here.

> 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

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list