Subject: Re: KNF and braces (was: Re: EGCS 1.1 UPDATE rev. 4)
To: None <current-users@netbsd.org>
From: Dave Sainty <dave@dtsp.co.nz>
List: current-users
Date: 08/19/1998 21:34:42
Danny Thomas writes:

> Ted Lemon <mellon@hoffman.vix.com> quoth:
> >> >   (4) KNF will be changed so that fully-braced blocks are encouraged.
> >>
> >> I like this best of all.
> >
> >Yicch.   Plese, no.   We're all adults here.   We can figure out
> >whether or not we need to enclose a statement in braces when we add a
> >printf.   Extraneous braces are inelegant.
> 
> I've always been amused by the various styles of braces people advocate.
> 
> I find braces distracting, particularly when they're on lines by themselves
> and personally put all of them at the end of lines containing real code,
> way off to the right. Indentation is how my eye perceives the code, though
> I guess others get used to 'their' styles.

Extra braces are horrible for a single line of code.  More than one
line (which includes one line of code and a comment) and braces are
"acceptable". :)

I now realise that perl was designed by a brace fanatic.  I could
never work out why perl was designed to be so ridiculously hard to
parse, yet extra braces were added apparently for no other reason than
to make it easier to parse (show me a human that can't parse one line
of code without braces and I'll show you a "Visual Basic
professional"...  Or a perl professional :).

Indenting solves the human parsing problem.  No need to strech the
code vertically as well as horizontally.

That'll be two cents, please... :)

Dave.