Reddit: why aren't people using D?

Michiel Helvensteijn m.helvensteijn.remove at gmail.com
Thu Jul 23 08:18:11 PDT 2009


Andrei Alexandrescu wrote:

> The issues are discussed in the book C++ Coding Standards and also in
> More Effective C++. Part of the problem is slicing, which you may want
> to google for.

I'm aware of slicing. I didn't really think of it as a problem. But now that
you mention it, I suppose it can be confusing. And perhaps violate class
invariants.

There may be a solution. What I'm thinking now is that in the background,
the heap may be used, as long as this is transparent to the programmer.
i.e. assignment still makes a copy, comparison still compares the objects,
not the addresses. But a base class value variable still has a superclass
object in the background.

This requires some thinking. Thanks for the clarification.

-- 
Michiel Helvensteijn




More information about the Digitalmars-d mailing list