Specifying C++ symbols in C++ namespaces

Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com> Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com>
Sat Apr 5 05:30:27 PDT 2014


On Saturday, 5 April 2014 at 12:07:36 UTC, Dicebot wrote:
> D has own tools to disambugate symbols. Introducing new ones is 
> equivalent to admitting D module system does not work by design.

I think it is primarily a notation issue. Should the notation 
help you discern what is C++ and what is D, or do you have to 
memorize symbols? How much extra notational work is it acceptable 
to impose on the programmer?

There are advantages and disadvantages to both approaches.

Pro explicit c++ namespaces:

- Easy to discern what is C++ and what is D.

- Less chance of future irreconcilable design conflicts when 
either C++ or D changes (e.g. C++18 and beyond)

- Having a philosophy of "native foreign functions" rather than 
"masquerading as D constructs" makes it easier to integrate with 
other languages beyond c/c++ at a later stage.

Con:

- More syntax to understand for newbies

- Requires a little bit more refactoring when moving C++ code to 
D.


More information about the Digitalmars-d mailing list