Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 1995 13:28:58 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        nate@rocky.sri.MT.net (Nate Williams)
Cc:        terry@lambert.org, nate@rocky.sri.MT.net, davidg@root.com, hackers@freefall.freebsd.org
Subject:   Re: Coding style ( was Re: why is this not a bug in namei?)
Message-ID:  <199509192028.NAA10566@phaeton.artisoft.com>
In-Reply-To: <199509191905.NAA25538@rocky.sri.MT.net> from "Nate Williams" at Sep 19, 95 01:05:33 pm

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



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