From owner-freebsd-chat Fri Nov 22 21:48:15 2002 Delivered-To: freebsd-chat@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AFB5A37B401 for ; Fri, 22 Nov 2002 21:48:13 -0800 (PST) Received: from post-21.mail.nl.demon.net (post-21.mail.nl.demon.net [194.159.73.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id EFDD943E3B for ; Fri, 22 Nov 2002 21:48:12 -0800 (PST) (envelope-from cls@raggedclown.net) Received: from [212.238.197.102] (helo=mailhost.raggedclown.net) by post-21.mail.nl.demon.net with esmtp (Exim 3.36 #1) id 18FT9I-000I3S-00 for freebsd-chat@FreeBSD.org; Sat, 23 Nov 2002 05:48:12 +0000 Received: from localhost (localhost [127.0.0.1]) by mailhost.raggedclown.net (Ragged Clown Mail Gateway [dawn]) with ESMTP id 01D4F832A for ; Sat, 23 Nov 2002 06:48:11 +0100 (CET) Received: from willow.raggedclown.net (willow.raggedclown.intra [192.168.1.10]) by mailhost.raggedclown.net (Ragged Clown Mail Gateway [dawn]) with ESMTP id 11E901854 for ; Sat, 23 Nov 2002 06:48:00 +0100 (CET) Received: by willow.raggedclown.net (Ragged Clown Host [willow], from userid 1009) id F2577225F8; Sat, 23 Nov 2002 06:48:00 +0100 (CET) Date: Sat, 23 Nov 2002 06:48:00 +0100 From: Cliff Sarginson To: freebsd-chat@FreeBSD.org Subject: Re: Style(9) question Message-ID: <20021123054800.GB10380@raggedclown.net> References: <20021122193040.GA23078@dogma.freebsd-uk.eu.org> <20021123020701.GA24845@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021123020701.GA24845@dogma.freebsd-uk.eu.org> User-Agent: Mutt/1.5.1i X-Virus-Scanned: by AMaViS 0.3.12pre8 Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sat, Nov 23, 2002 at 02:07:01AM +0000, Jonathon McKitrick wrote: > On Fri, Nov 22, 2002 at 04:08:08PM -0500, John Baldwin wrote: > | The reason to not put them in is to avoid wasting screen real-estate > | on mostly blank lines. You also errantly assume that you will always > | come back and add more statements later. :) > > Ah, good answer. Thanks! > I always preferred it this way, but most on my team use the braces. > Is it a good answer ? I find it an incredible one ! I don't actually use braces on a single-liners, so I am not arguing either way - although theoretically I think it is probably a good idea. But I learnt "C" out of thw white-book many years ago and I generally write in the style found there (with a few exceptions ...:) But I really cannot believe that the reason is space on the screen ! I would be more likely to believe it was just someone's decision, not necessarily with a rationale behind it. Maybe it was valid when code was written on DecWriters using ed(1). Having been involved in writing style guidelines they are always a compromise, the cause of many heated debates and disgruntled people. Indentation levels is another one people go into apoplexy over as well. Well my feeling is you need a set of style rules that people, however grudgingly have to accept for new source modules. If you are updating existing code I think it is only sensible to follow the style that the particular code uses. This is a practical matter, is it worth the time to re-arrange exisisting code (with there always being the chance of introducing new bugs by mistypes) ? Either that or insist all programs are post-processed through a "C" beautifier. Although I have yet to ever see one that deserves the word beauty in it's description. -- Regards Cliff Sarginson The Netherlands [ This mail has been checked as virus-free ] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message