From owner-freebsd-current Wed May 29 17:14:45 2002 Delivered-To: freebsd-current@freebsd.org Received: from evilpete.dyndns.org (12-232-26-46.client.attbi.com [12.232.26.46]) by hub.freebsd.org (Postfix) with ESMTP id 8435337B409; Wed, 29 May 2002 17:14:31 -0700 (PDT) Received: from overcee.wemm.org ([10.0.0.3]) by evilpete.dyndns.org (8.11.6/8.11.6) with ESMTP id g4U0EV166520; Wed, 29 May 2002 17:14:31 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id DC4D0380A; Wed, 29 May 2002 17:14:30 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Julian Elischer Cc: John Baldwin , FreeBSD current users Subject: Re: Seeking OK to commit KSE MIII In-Reply-To: Date: Wed, 29 May 2002 17:14:30 -0700 From: Peter Wemm Message-Id: <20020530001430.DC4D0380A@overcee.wemm.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Julian Elischer wrote: > On Wed, 29 May 2002, Julian Elischer wrote: > > On Wed, 29 May 2002, John Baldwin wrote: > > > 4) It would be nice if you didn't mix in gratuitous style changes with > > > actual content changes such as extra braces in else clause of > > > PROCFS_CTRL_WAIT case in procfs_ctl.c > > I don't consider that to be a "gratuitous style change". > I'm rewriting the clause and consider that as a 3 line clasue with 2 > levels of indent it makes it more "error resistant" to have the braces.. > The 'then' clause has braces so teh else one should too. > > if (foo) { > fumble(); > futz(); > } else > bah; > > always really annoys me. > If I'm looking for the end of the if statement, I'm looing for a '}'.. We've been over this particular case several times before. After the dust has settled, we've decided that we would allow it as long as it wasn't excessive. ie: it is ok to change this: if (foo) { fumble(); futz(); } else bah; into } else { bah; } or to change this: if (foo) fumble(); else { futz(); bah; } into: if (foo) { fumble(); } else { But it is generally NOT ok do change: if (foo) fumble() else futz(); into: if (foo) { fumble(); } else { futz(); } Of course, a couple of provisos apply: - It is preferable to do this as a seperate commit. Note: preferable. - It is not appropriate to do this on sections of code that we are ever likely to have to sync up with somebody else. (unless the other parties are doing something similar). - reformatting rampages are not OK (we've had these before, see the "Delete trailing whitespace" commits and the flamewar that resulted). - Use good judgement when changing stuff. Do not change things into one's own perferred style when it is well known that folks object strongly to that particular style. The style guide is a "common ground" that we've all agreed to try and adhere to vs using our own. (I personally came from a 2-space indent background, etc. I had to make big concessions to the common format just like everybody else.) Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message