Class Initialization

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jan 31 12:11:08 PST 2012


On Tue, Jan 31, 2012 at 08:49:25PM +0100, Andrej Mitrovic wrote:
> On 1/31/12, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> > In D however, the _entire_ type is created and default
> > initialized before the first constructor is called.
> 
> I was reading the C++ Object Model book recently (well, I'm still
> reading) and was amazed at how many edge-cases there are in C++, and
> how lucky I am to be using D. Well, minus the Optlink that is. :)

OOP in C++ is so broken that I have given up on OO in C++ altogether. I
just write C++ code as "C with classes". I have come to hold the opinion
that real OO cannot be done properly in C++ (not without lots and lots
of pain, hacks, workarounds, and bandages, anyway).  OO in Java is much
saner.

But I'm glad to say that OO in D is turning out to be much better so
far.  It's what C++ should have been but failed to be.


T

-- 
My program has no bugs! Only unintentional features...


More information about the Digitalmars-d-learn mailing list