Subject: Re: KNF and braces (was: Re: EGCS 1.1 UPDATE rev. 4)
To: Ted Lemon <mellon@hoffman.vix.com>
From: Guenther Grau <Guenther.Grau@bk.bosch.de>
List: current-users
Date: 08/19/1998 10:52:11
Ted Lemon wrote:
> 
> > How do you feel about "extraneous" parentheses to force or clarify
> > expression evaluation order? I parenthesize obsessively, for exactly the
> > reasons that I {} everything - the two reasons above.
[...]
> I don't buy the notion that extra braces increase reliability.   Only
> a complete moron or a vi user would ever make the mistake of thinking
> that something was part of a conditional statement when it was not.

Not that my oppinion counts anything, but just as another data point:

Following your argumentation I must be a moron, because I don't use vi
and yes, this mistake has happened to me in exactly the way Chris 
described it. Just use a dump macro written by someone else and wonder
why your code doesn't work properly. Also, add a debugging printf, just
one line without using emacs' indentation support, and see your code
doing
something completely differently. IMHO, code should be written as
obvious
as possible. Adding the extra braces needed for this will take away one
line of screen estate for each if and make it so much clearer to the
reader.

Besides, if seen wrongly indented code which suggested that things would
be executed in a different order. With braces, it just doesn't matter
how you indent your code. It's obvious how it will work.

Thus I'd strongly support Chris an Jason and the other supporters for
adding braces. PLease change the style guide to encourage people to add
braces (and parantheses for that matter :-)

Thanx,

  Guenther