Parenthesis

Steve Horne stephenwantshornenospam100 at aol.com
Fri Dec 22 23:53:19 PST 2006


On Fri, 22 Dec 2006 15:49:22 -0600, Chris Nicholson-Sauls
<ibisbasenji at gmail.com> wrote:

>Personally, I almost always write in the braces.  It just makes things so much simpler if 
>I later need to go back and expand that statement body, or want to add debugging/temporary 
>output or checks of some kind.

To me, redundant braces are extra clutter, making it harder to read
the code. I used to always use them in the past, back when I was more
Pascal-family-influenced than now, but over time I just got irritated
with them. And leaving them out has never caused a problem.

The basic rule is that if I only drop the braces if the whole block
statement is on a single line - a useful way to tidy up code, and
something that can be done similarly in Pascal, but not really
Modula-2 or Ada due to begin/end issues.

Of course the amount of clutter we're talking about from braces is a
trivial issue. Just like adding in the braces when they are needed is
a trivial issue.

Not that anything above should influence anyone one way or the other.
The point is that both views are equally valid. There never will be a
definitive right way.

-- 
Remove 'wants' and 'nospam' from e-mail.



More information about the Digitalmars-d mailing list