From owner-freebsd-chat Mon Jan 22 17:32:55 2001 Delivered-To: freebsd-chat@freebsd.org Received: from ocis.ocis.net (ocis.ocis.net [209.52.173.1]) by hub.freebsd.org (Postfix) with ESMTP id 499CB37B402 for ; Mon, 22 Jan 2001 17:32:37 -0800 (PST) Received: from phoenix (freddie.boonie.org [209.52.175.37]) by ocis.ocis.net (8.9.3/8.9.3) with ESMTP id RAA29365 for ; Mon, 22 Jan 2001 17:32:36 -0800 From: "Freddie Cash" To: freebsd-chat@freebsd.org Date: Mon, 22 Jan 2001 17:31:44 -0800 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: silly C style question Reply-To: fcash@bigfoot.com Message-ID: <3A6C6E80.4535.632D3C1@localhost> In-reply-to: <200101221743.f0MHh7I61638@gratis.grondar.za> References: <20010122170600.D4456@dogma.freebsd-uk.eu.org> ; from j mckitrick "Mon, 22 Jan 2001 17:06:00 GMT." X-mailer: Pegasus Mail for Win32 (v3.12c) Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 22 Jan 2001, at 19:43, Mark Murray wrote: > > This is a trivial question, but I get hung up on details, so I'm gonna > > ask anyway. ;) > OOOOOPPPPPPENNN Bikeshed! ;-) > > 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); > > } > IMHO, this wastes one line of screen space. I only use it for functions. Bah! If you are worried about screen space and legibility, there's always the following: if (0==i) { foo(i); bar(i); } which is what we use here. > > versus > > > > if (0 == i) { > > foo(i); > > bar(i); > > } > > "Classic" K&R. Allows a little more code per screen. However, there is no such thing as "The One True Style" just as there is no such thing as "The Perfect Pair of Pants", or "The One True Cookbook". Everyone has their own way, and so long as it is legible to the vast majority, then it works for me. Cheers Freddie fcash@bigfoot.com ---------- Hackers make toys. Crackers break them. -- Peter Seebach For my public PGP key, send e-mail with subject: PGP KEY REQUEST To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message