Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 1999 11:02:48 -0700
From:      Warner Losh <imp@village.org>
To:        Julian Elischer <julian@whistle.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: btokup().. patch to STYLE(9) (fwd) 
Message-ID:  <199901291802.LAA67403@harmony.village.org>
In-Reply-To: Your message of "Fri, 29 Jan 1999 09:48:19 PST." <Pine.BSF.4.05.9901290941240.304-100000@s204m82.isp.whistle.com> 
References:  <Pine.BSF.4.05.9901290941240.304-100000@s204m82.isp.whistle.com>  

next in thread | previous in thread | raw e-mail | index | archive | help
: If I were working on this code  written by someone else it'd leave my
: editor looking like the top example, that's for sure. I think that 
: "How easy is it to edit a piece of code and still have it do what you
: expect" is an important consideration, because people DO edit things.

Agreed.

: > I do agree that complex things like:
: > 
: > 	if (a | b & c % d ^ e)
: > 
: > should really have some parents to show what is going on.
: 
: I have NO idea of what that is doing and I have plans of looking it up in
: the book to work it out..

Yes.  I agree with that.  
 	if (a | b & c % d ^ e)
should have been written as:
 	if (((a | (b & (c % d))) ^ e) != 0)
(then again, either way it is ugly code and should have comments).

: OK so where is the line.. I find that in code I'm working on I have many
: more
: arens that you would like..
: does that mean that I should be forced to take them out when I commit it
: and therefore probably produce erorrs?

No.  Style(9), imho, is more a guide than a hard and fast thou shalt
in all cases.  I don't think that you should do anything to increase
errors.  I would say that if you are adding/editing code to a moudle,
you shouldn't go messing with what is there.  If you are writing new
code, then do what will make the code most reliable.  If you did
extensive testing with parens, think twice about removing (and vice
versa).

As a friend of mine put it: "You can't legislate common sense."

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?199901291802.LAA67403>