S
spinoza1111
I think you've missed the point. The parentheses around (a) are not
the issue because they are, of course, correct. The problem is the
lack of parentheses around the conditional expression.
Correctomundo: the conditional expression violates "my" rule, which I
developed in 1990, that "each macro that intends to return an
EXPRESSION must return an EXPRESSION surrounded by PARENTHESES: each
macro that intends to return a STATEMENT must return a STATEMENT LIST
surrounded by BRACES".
Why would
someone suggest that ABS might be written that way? It will trip
every beginner up.
Herb should have known the rule; he probably did know the rule.
However, most of his audience works in shops where rules in excess of
the language are known as "standards", and in these shops, employees
who cultivate their own approaches (including approaches that might be
recommended by people who consider themselves hotshots) are terminated
as "not part of the team". Therefore, it seems that Schildt and/or his
editors decided not to include a variety of "coding standards" that
have evolved because of the poor design of C.
Furthermore, a beginner taught a certain style which is in excess of
the rules of the language will be less quick to understand code
written in a different idiom, and many newbies are expected to change
code.
These "coding standards" that you wanted Herb to use are little more
than tics and pathologies in the sense that they are antibodies to the
grand pathology.
What is the grand pathology?
It is the basically sexual anxiety that causes technical males,
unwilling to admit their subordination, effeminisation and
brutalization by the corporate Big Other, to try to retrieve an ersatz
masculinity by pretending that an inferior language (C) is somehow
"close to the machine", and somehow more Authentic. This rage for
Authenticity is of course a tic of the profoundly inauthentic.
The coding standards, while effective in the case of "parenthesize
formal parameters in macros, when returning an expression return it in
parentheses, and when returning a list of C statements, make that list
into one compound statement by encasing the macro body in braces", are
like the body's immune system response to the HIV virus: the disease
is manifest in the response. The fact that these tics are needed
indicates that C sucks.
Code like that does not help anyone who has to deal with C in a real
job. People like that need correct examples and models of good
style. Why, for example, is he using 'gets'; C's worst function (and
an officially deprecated one) if he is just trying to help people muddle
though with this terrible language?
Don't blame Herb for the cowardice of C standards writers who won't
get rid of bad features once and for all when this might harm the
profits of vendors. The fact is that even if replacement features
exist, this newsgroup alone shows not even a rough consensus as to
what they should be, except for a consensus enforced by Fat Bastards
and their threats.