Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jan 2001 20:23:35 +1000
From:      Stephen McKay <mckay@thehub.com.au>
To:        j mckitrick <jcm@FreeBSD-uk.eu.org>
Cc:        chat@freebsd.org, mckay@thehub.com.au
Subject:   Re: silly C style question 
Message-ID:  <200101231023.f0NANZI18506@dungeon.home>
In-Reply-To: <20010122170600.D4456@dogma.freebsd-uk.eu.org> from j mckitrick at "Mon, 22 Jan 2001 17:06:00 %2B0000"
References:  <20010122170600.D4456@dogma.freebsd-uk.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, 22nd January 2001, j mckitrick wrote:

>This is a trivial question, but I get hung up on details, so I'm gonna ask
>anyway.  ;)

    "I'm here for an argument."

    "Is that a 5 minute argument, or the full half hour?"

>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);
>}
>
>versus
>
>if (0 == i) {
>	foo(i);
>	bar(i);
>}

Use neither of these!  Use:

if (i == 0)
    {
    foo(i);
    bar(i);
    }

You Know It Makes Sense(tm).

Stephen.

PS The full justification for disagreeing with most of the civilised
world can be yours for the price of an enquiring email.

PPS  `0 == i' is so clearly wrong I can't explain it further.

PPPS The official GNU style is the ugliest I've ever seen, and it's
hard to imagine a worse one.  Glad you didn't bring it up here.


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?200101231023.f0NANZI18506>