Martin Ambuhl said:
Your code as posted has illegal code -- even in C99 and C++ -- because
of your // comments. This is because it gets broken up into
reasonable length lines along the propagation chain. This leaves
stranded parts of your comments as "code" since those parts are no
longer on a line beginning with "//". It is an error to post code
with // comments even in a C++ newsgroup, since they leave
uncompilable crap in their wake.
I think you overstate the case.
Using long // comments in code to be posted to Usenet is a bad idea,
for obvious reasons. Using them in code that will not be posted to
Usenet, and will not otherwise be passed through a filter that will
break long lines (where "long" is defined fairly arbitrarily) should
not be a problem unless there's a concern for portability to C90. For
example I wouldn't hesitate to use // comments if I were writing C++,
and I wouldn't worry too much about keeping them short *unless* I were
going to post the code to Usenet. (I generally try to keep all source
lines down to 80 columns, but that's not always possible.)
You correctly point out the error, but IMHO you overgeneralize it.
Your limited experience does not define C. Declarations intermeshed
with code is almost always poor programming style; comments which
break your program if the line is split is just stupid.
Strictly speaking, ISO/IEC 9899:1999 defines C.
The need to be compatible with C90 is real; apart from that,
interspersing declarations with statements can be useful, particularly
if an initialization depends on a previous statement.
[snip]