Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jan 2001 18:50:20 +0100
From:      Tore Lund <tl001@online.no>
To:        freebsd-chat@FreeBSD.ORG
Subject:   Re: silly C style question
Message-ID:  <3A6C72DC.7F5F817@online.no>
References:  <20010122170600.D4456@dogma.freebsd-uk.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
j mckitrick wrote:
> 
> This is a trivial question, but I get hung up on details, so I'm gonna ask
> anyway.  ;)
> 
> When using opening and closing braces for a loop or other control structure,
> most coders put the opening brace on the same line as the decision
> statement.  It seems to me, using it in more of a block format would make
> the code easier to read.  Does this make sense?
> 
> if (0 == i)
> {
>         foo(i);
>         bar(i);
> }

Beautiful!  That's what I call *symmetry*, *style*, etc. etc.
 
> versus
> 
> if (0 == i) {
>         foo(i);
>         bar(i);
> }

Totally unreadable!

Unfortunately, there is no objective way to decide which style makes the
code easier to read.  Take a look through the FreeBSD sources, and you
may realize what sort of flame war you have just started.  At least this
is closer to topic than the discussion on mobile phones.
-- 
    Tore



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A6C72DC.7F5F817>