Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 1999 09:08:54 -0700
From:      Warner Losh <imp@village.org>
To:        Andrew Kenneth Milton <akm@zeus.theinternet.com.au>
Cc:        current@FreeBSD.ORG
Subject:   Re: btokup().. patch to STYLE(9) (fwd) 
Message-ID:  <199901291608.JAA66178@harmony.village.org>
In-Reply-To: Your message of "Fri, 29 Jan 1999 21:21:55 %2B1000." <199901291121.VAA01208@zeus.theinternet.com.au> 
References:  <199901291121.VAA01208@zeus.theinternet.com.au>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <199901291121.VAA01208@zeus.theinternet.com.au> Andrew Kenneth Milton writes:
: The only arguments I've seen for less 'punctuation' are 
: 
: a) "I" don't need them
: b) "I" don't like what it looks like with them
: c) There might be bugs introduced due to parens.
: 
: Well a and b are crap, and c is no worse off than we are now, since
: there seems to be bugs caused by a lack of them.

A and B aren't crap.

Style(9) should allow extra parens in very complex situations, but
still prohibit them in innane ones:

	if ((a < 0) && (b < 0))

should be prohibited since the designers of C anticipated this and
made
	if (a < 0 && b < 0)

do the right thing.  The latter is easier on the eyes and uses the 80
columns better.

I do agree that complex things like:

	if (a | b & c % d ^ e)

should really have some parents to show what is going on.

So I agree with phk on this one: Use fewer parens generally, but use
common sense in adding them in the more obscure cases where they do
legitimately add readability.

Warner

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?199901291608.JAA66178>