Andrei Alexandrescu wrote: > Well I use it sometimes too, but it's so fraught with peril that > virtually all coding standards I've ever seen, all books and magazine > articles on the topic, all pundits, say one thing: don't. Better use > composition.
My take on composition vs inheritance is very simple: always use composition, unless you absolutely need inheritance. Sometimes I absolutely need inheritance, and D isn't giving it to me. I don't care about your coding standards. I know how to use C++. I have my own rules about how to use it safely and effectively, rules that I have spent a lifetime refining. I still make mistakes, but almost all of my bugs are of the simple stupid kind that can be made in all languages. I don't need or want D to protect me from the pitfalls of C++ if this means significantly reducing the expressive power of the language. I don't want a safe language for little kids, I want a real language for adults. (And, truly, D is better in this regard than many of its competitors. Perhaps the awesome power of string mixins will be enough to offset its missing features. I will definitely give D2 a try when it is finished.) -- Rainer Deyke - [email protected]
