"Malcolm McLean" <re*******@btinternet.comwrote in message
news:j_******************************@bt.com...
"P.J. Plauger" <pj*@dinkumware.comwrote in message >>Therefore the
underscores had to come out.
>>
Out of curiosity, what was the compiler and what were the keywords?
The only case I know of in recent memory is managed VC++ with its
gcnew keyword.
Did you ever wonder why the Managed Extensions have all those ugly
underbar keywords like __gc and __value? Because the Managed Extensions
religiously follow the C++ standard, which says, "If thou really must
introduce new keywords, thou shalt name them beginning with double
underscore!" But guess what? When Microsoft introduced __gc, __value and
the rest, the Redmondtonians received "unexpectedly strong" complaints
from programmers. Yeah! Programmers of the world, unite! You have nothing
to lose but your underbars. Underbars make your code look icky, like some
kind of assembly language program or something. So C++/CLI has ref and
value, sans underscores. This meant adding new keywords to C++, but so
what?
Uh, no it doesn't. See below.
As Bjarne
says, "My experience is that people are addicted to keywords for
introducing concepts to the point where a concept that doesn't have its
own keyword is surprisingly hard to teach. This effect is more important
and deep-rooted than people's vocally expressed dislike for new keywords."
(True, true. I love that Bjarne is describing the psychology of
programming.) So C++/CLI ditched the underbars. By making them positional
keywords instead of reserved keywords, they can't conflict with programs
that may already use these words as variable or function names.
Full text:
http://msdn.microsoft.com/msdnmag/is...k/default.aspx
Wait a minute -- you can't have it both ways. Aside from the gcnew I
mentioned, *none* of the alleged keywords Microsoft introduced infringe
on the user name space. So they're not really keywords. And so
Microsoft is actually being a very good citizen with C++/CLI. But all
you said was:
: Therefore the underscores had to come out.
Thus encouraging Mark L. Pappin to opine:
: They deserve condemnation for polluting the user's namespace.
Truth to tell, I have never seen a cleaner dialect of C or C++
introduced over the past third of a century. In fact, I had to
disable the namespace-purity tests in our validation suite over
a decade ago because I can't find an implementation of either
language that even tries to honor the full requirements of the
C and/or C++ Standards. (And I'm the guy who fought for, and
won, the separation of name spaces in both standards.)
Every Unix/Linux/*ix has its complement of open/close/read/write
/seek/etc. Try redefining any of these as an external symbol and
your executable will probably blow sky high. Every commercial
compiler drags a tail decades long of additions that no vendor
dares remove, lest they alienate their installed base. The
Dinkumware library can be configured to be namespace pure, but
we haven't had an OEM ask us to do so for more years than I can
count. Keywords, macros, and external symbols not reserved to
the implementation are all violations of the Standards contract,
and they're all ubiquitous.
So here we have a case of Microsoft doing a *better* job of
honoring the C and C++ Standards than anybody else and what do
they get? An undeserved trashing. Mind you, I'm not saying that
the folks in Redmond have never been above reproach, but when
they do something right they deserve to be recognized for it,
not savaged with misinformation.
P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com