Stroustrup is disappointed with D :(

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 23 07:14:02 PDT 2015


On Wednesday, 23 September 2015 at 14:01:11 UTC, Steven 
Schveighoffer wrote:
> If the base ctor doesn't call any virtual functions, when it's 
> constructed doesn't really matter.

1. In D members are virtual by default, so the virtuality can be 
a mistake.

2. In D/C++ you can do full override of virtual members, that 
means that enforcing semantics are delegated to documentation and 
code review. This is a flaw inherited from Simula.

> I don't see how you come to that conclusion. The derived class 
> must control construction of the base class.

No, this is not how it is done in Simula/Beta. The construction 
is controlled from the base classes and follows the inheritance 
chain.

Doing construction in the opposite direction is a C++ flaw, 
probably related to C.

But neither C/C++ are good role models when it comes to typing.

> It requires slightly more careful thought (and some rules from 
> the compiler), but it scales just fine.

I don't think it scales "just fine". OO in C++ does not scale 
fine either. If you easily can break the super-class semantics in 
a sub-class then it does not scale. Alias this suffers from 
similar issues.



More information about the Digitalmars-d mailing list