From owner-freebsd-hackers Tue Sep 19 13:32:39 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA28189 for hackers-outgoing; Tue, 19 Sep 1995 13:32:39 -0700 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id NAA28182 for ; Tue, 19 Sep 1995 13:32:32 -0700 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id NAA10566; Tue, 19 Sep 1995 13:28:59 -0700 From: Terry Lambert Message-Id: <199509192028.NAA10566@phaeton.artisoft.com> Subject: Re: Coding style ( was Re: why is this not a bug in namei?) To: nate@rocky.sri.MT.net (Nate Williams) Date: Tue, 19 Sep 1995 13:28:58 -0700 (MST) Cc: terry@lambert.org, nate@rocky.sri.MT.net, davidg@root.com, hackers@freefall.freebsd.org In-Reply-To: <199509191905.NAA25538@rocky.sri.MT.net> from "Nate Williams" at Sep 19, 95 01:05:33 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 2379 Sender: owner-hackers@FreeBSD.org Precedence: bulk > > > > 9 items in short term memory simultaneously. That would be why phone > > > > numbers are 7 digits. > > > > > > > > I'm not even taxing the low end of the study participants. > > > > > > What this has to do with you using goto's I have no idea. > > > > It shows that David's complaint about 3 goto's is religious, and not as > > he said a result of battling obfuscation. > > Huh, you lost me here. Look. For humans to become confused, you need to stuff more than 5-9 things in front of their face in order to decouple their short term memory. To put this in computerese, humans have a 5-9 item cache. If you don't go over 5, then you don't bust the cache on even substandard humans (manufactured by Cyrix?). David's complaint is that 3 goto's obfuscate things. In reality, >5-9 goto's obfuscate things (by overflowing a human's cache). He pulled the number 3 out of the air based on his religion in this regard. > > Getting to the one function exit the way the BSD code is currently > > written requires a goto. > > If the code *needs* to be written that way, then I can see your point, > but I don't see that as part of KNF. The only thing even mentioning > exits implies that you can have multiple exits in any function. > > I quote: > /* > * Exits should be 0 on success, and 1 on failure. Don't denote > * all the possible exit points, using the integers 1 through 300. > */ > exit(0); /* Avoid obvious comments such as "Exit 0 on success." */ This is a problem in the general applicability of the specification. Many kernel functions return an errno value. Either this specification doesn't apply to that code, or that code is in fact flawed. Pick one. > > I look forward to your and David's patches to the following functions, > > and to the functions not in these two subdirectories that have the same > > "goto infestation problem": > > AFAIK, we are discussing new code re-writes, not changing already > existing code. Re-writing all of the existing code is a worthy task, > but there are much worthier tasks that need to be done. If this is a form vs. function argument now, then I have already won, since you also seem to be on the side of function. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.