Games people play
Walter Bright
newshound at digitalmars.com
Thu Sep 28 13:45:55 PDT 2006
Georg Wrede wrote:
> Or, could it be that D actually is bigger than C++ _feature_wise_, while
> C++ is _much_ larger than D when we look at the ramifications of their
> respective feature sets.
D *is* bigger feature wise. But complexity wise, C++ beats it. The
trouble with C++ is that its features are not very orthogonal - and
where they interact/conflict there are a lot of weird special case
rules. I have recently exchanged yet another set of emails with a person
who is a top C++ expert who insisted that DMC++ had a serious bug with
template name lookups. Turns out that DMC++ actually was implementing
the name lookup rules *according to the C++ standard* and the other
compilers were not. The bottom line is even the experts don't know how
it is supposed to work.
Another example is the preprocessor. It took 10+ years for C/C++
compiler vendors to implement it correctly. This isn't because doing a
macro processor is inherently difficult, it is because the specification
for C's macro language is so obtuse and full of bizarre special cases. I
know I've spent countless hours trying to figure out (1) how it's
supposed to work and (2) how to implement it. It's been scrapped and
totally reimplemented about 4 times.
> What I mean is, one could write a "complete"
> book about D, and it still would be just a fraction of the size of
> Stroustrup's "C++". And that's because most of his book explains and
> chews on issues and implications that are unobvious to the reader or
> programmer, and that demand knowing them lest you shoot yourself in the
> foot -- and not even later understand what happened.
>
> D has virtually no such crap, so we can scrap 500 pages right off the bat.
Consider just one issue with C++ - how to write a "correct" iterator
class. Even harder is writing a "correct" container class.
More information about the Digitalmars-d
mailing list