DIP61: Add namespaces to D

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 26 11:21:42 PDT 2014


On Saturday, 26 April 2014 at 18:11:18 UTC, Walter Bright wrote:
> On 4/26/2014 4:57 AM, Dicebot wrote:
>> Necessity to define namespaces for
>> interfacing with C++ must not result in usage of namespaces of 
>> pure D code.
>
> Why?
>
> I don't see much of any use for namespaces in pure D code, 
> though I could be surprised.

Because using namespaces is considered good practice in C++. 
Those coming from languages with natural namespace support will 
see feature with same name and semantics in D code and will 
proceed with using it casually, resulting in lot of unidiomatic D 
libraries and applications out there.

Namespaces are also much more familiar and simple thing to grasp 
compared to original D module system. Providing those will doom D 
modules because of path of least resistance - lack of good 
practices here makes situation rather bad already, no need to 
make it even worse.

Namespaces also don't solve any problem for that can't be already 
elegantly solved. We are very reluctant to add new useful 
features because of implied implementation, documentation and 
learning overhead. Abandoning that principle to add a useless 
feature instead is just horrible.


More information about the Digitalmars-d mailing list