From owner-freebsd-chat Mon Jan 22 9:55: 4 2001 Delivered-To: freebsd-chat@freebsd.org Received: from mail44.fg.online.no (mail44-s.fg.online.no [148.122.161.44]) by hub.freebsd.org (Postfix) with ESMTP id 03FEE37B404 for ; Mon, 22 Jan 2001 09:54:45 -0800 (PST) Received: from online.no (ti34a05-0209.dialup.online.no [130.67.71.209]) by mail44.fg.online.no (8.9.3/8.9.3) with ESMTP id SAA18297 for ; Mon, 22 Jan 2001 18:54:38 +0100 (MET) Message-ID: <3A6C72DC.7F5F817@online.no> Date: Mon, 22 Jan 2001 18:50:20 +0100 From: Tore Lund X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; U) X-Accept-Language: en,pdf MIME-Version: 1.0 To: freebsd-chat@FreeBSD.ORG Subject: Re: silly C style question References: <20010122170600.D4456@dogma.freebsd-uk.eu.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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