This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: verbose terminate() on by default, pass 2
On Wed, Dec 25, 2002 at 02:40:33AM -0800, Ulrich Drepper wrote:
> ... I really cannot
> understand how somebody, who claims to have thought about these issues,
> can try to argue for it.
Consider that among all of the dozen and a half serious C++ texts I have
immediately at hand, only two use the old C convention. Those two were
written by people who have never written C++ code for production. When
every serious, experienced writer on a topic disagrees with you, you
really might stop to think that maybe (just maybe!) you are not quite
so omniscient as you prefer to believe.
The rule in C++ is that only one name should be defined in a declaration.
That eliminates every argument about dangers of lines like "char* a, b;".
Furthermore, since in C++ declarations are mixed in with statements, it
is usually an error to declare a name without initializing it. When you
declare and initialize a pointer, a notation like "char *p = q;" is a lie:
it appears to assign *p, when in fact it is initializing p.
In C, definitions are necessarily separate from statements, and none
of these arguments apply, so nobody suggests applying the C++ rule to C.
Only inexperience, inertia, or arrogance can argue for applying the
C rule to C++.
Nathan Myers
ncm-nospam@cantrip.org