Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 May 2002 17:14:30 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        John Baldwin <jhb@FreeBSD.ORG>, FreeBSD current users <current@FreeBSD.ORG>
Subject:   Re: Seeking OK to commit KSE MIII 
Message-ID:  <20020530001430.DC4D0380A@overcee.wemm.org>
In-Reply-To: <Pine.BSF.4.21.0205291403090.12315-100000@InterJet.elischer.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020530001430.DC4D0380A>