[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: usage of reserved C++-keyword in cthreads.h



Jeff Bailey <jbailey@nisa.net> writes:

> It's no harder or more complicated than making a header file work with
> both K&R and ANSI, especially now that C++ is standardized.  It's just
> a matter of whether the authors wanted to do so or not.

No, no, no, you've missed the point entirely.

I could make a header file that is compatible with Scheme if I wanted
to.  But I don't want to, and there's nothing irrational about not
wanting to.

Indeed, you'll note we don't bother trying to support old K&R C at
all--for perfectly good reasons.

For every language P, we could make the header work happily with
language P.  And for every such language, it's easy to do so.  But the
cost of doing so for all the languages P rather than just one is very
high.  

It's got nothing to do with whether C++ is a good language or not.
It's purely that it's a *different* language, and it's designers and
users are often strangely unaware of that fact.

Indeed, there is even a construct in C++, something like

extern "C" {
}

[pardon me if I've remembered it wrong]

which could even be profitably used for *just this purpose*, and yet,
it isn't.  If the designers of the language lied to you, and said "you
can just include any C header and it will work", then don't blame the
authors of those *headers* for the designer's lie.

I think it would be very easy for C++ to fix the damn parser so that
within the above construct (or one like it) it accepts C syntax.  But
instead, for some reason, everybody who just wants to write a C
program is flamed incessently for an inadequacy in C++!

> You've expressed your dislike of C++ before[0] [1] [2] (In case others
> want the references), so your desire not to support it isn't
> surprising.  I just think it's sad, considering that it's both trivial
> and generally accepted practice.

"generally accepted practice", actually, is Windows with Visual Basic.

Thomas



Reply to: