Unnecessary parentheses (Was: Help: VAX C problem)

John Macdonald jmm at eci386.uucp
Tue Apr 9 00:27:09 AEST 1991


In article <1991Apr2.185204.20516 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
|Parentheses inserted to make grouping clearer are "unnecessary" only to
|the compiler; almost nobody really has the C precedence rules memorized.

Even more important, almost nobody has the C precedence rules
internalized - memorized to the extent that reading an
unparenthesised complex expression is easier than reading the
same expression with careful (not necessarily total)
parenthesisation.

Many people will be able to internalize the precedence for
addition and multiplication and (almost any single other
operator) in a single expression and read such an expression
at least as easily without parentheses.  Such units make good
candidates for the bottom level of parenthesisation within
more complicated expressions.  Extra parentheses beyond these
may be appropriate also when an otherwise straightforward
expression is long - either because of lengthy variable names
or because the unary values are function calls with long
arguments lists or other large expressions.
-- 
sendmail - as easy to operate and as painless as using        | John Macdonald
manually powered dental tools on yourself - John R. MacMillan |   jmm at eci386



More information about the Comp.lang.c mailing list