System programming in D (Was: The God Language)

bearophile bearophileHUGS at lycos.com
Wed Jan 4 15:21:49 PST 2012


Walter:

> The only reason to use classes in D is for polymorphic behavior - and that means
> virtual functions.

I don't agree, in some cases I use final class instances instead of heap-allocated structs even when I don't need polymorphic behaviour just to avoid pointer syntax (there is also a bit higher probability of destructors being called, compared to heap-allocated structs).
In some cases I've used a final class just to be able to use a this() with no arguments :-)

Bye,
bearophile


More information about the Digitalmars-d mailing list