Re: C++ Frequently Questioned Answers
Andrei Alexandrescu (See Website For Email) wrote:
However, programmers in general and C++ programmers in particular are
very keen on only using the C++ compiler (to wit, many template and
preprocessor libraries and their uses). I'm not sure exactly why, but
there is an extraordinary appeal of staying within the language. In
fact, I'd love to gather opinions on why that's the case.
My opinion stems from those who used C source code generators like Yacc,
etc. The problem they'd always run into was portability. It's one thing
to get your C code to compile/run successfully on another platform. It's
another thing to get that running, *and* get the same version of the
code generator up on that platform. While C is fairly ubiquitous, those
code generators too often were not.
It's like when I tried to run Latex on Windows. It just didn't work.
Weird error messages, random crashes, etc., while on Ubuntu it worked
fine. Latex is a gigantic wad of code, there's no hope for a mere user
to ever try and fix the Windows port. I don't want to spend hours poking
around with Google trying to find a way to get it to stop hanging, or
why certain packages cannot be found by the automated Latex Windows
installer, etc.
As a C++ user, I'd be fairly confident that my C++ code will work on
another platform because there's enormous pressure for that to happen.
But C++ coupled with some other tool? Eh, I'll play it safe and not rely
on that.
Let's look at it another way. If my C++ code has a 90% chance of working
on another platform without problems, and Tool X has a 70% chance, the
combined chance of it working is 63%. As someone who'd want wide
adoption of whatever I'm working on, or to minimize tech support, I'll
choose the 90% C++ only solution over the 63% combined solution, even if
it costs me significantly more in development effort.
I'll give another example. Back in the bad old DOS days, I didn't have a
linker, but relied on the one that Microsoft shipped on every DOS disk.
The trouble was, Microsoft changed the linker constantly, and some
worked, some didn't work. I had to start a "linker collection", a list
of which versions worked and which didn't. After a while, this became an
unworkable tech support nightmare, and I was forced to get my own linker
so I could completely control the user experience with the compiler.
Other companies, like Glockenspiel, shipped a C++ translator that
converted C++ to C code. Glockenspiel had endless grief because they
didn't control the C compiler their customers were using. Every time any
C compiler vendor released a new version, Glockenspiel C++ broke.
----
Walter Bright
Digital Mars C, C++, D programming language compilers
http://www.digitalmars.com
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]