Date: Tue, 19 Sep 1995 13:05:33 -0600 From: Nate Williams <nate@rocky.sri.MT.net> To: Terry Lambert <terry@lambert.org> Cc: nate@rocky.sri.MT.net (Nate Williams), davidg@root.com, hackers@freefall.freebsd.org Subject: Re: Coding style ( was Re: why is this not a bug in namei?) Message-ID: <199509191905.NAA25538@rocky.sri.MT.net> In-Reply-To: <199509191852.LAA10314@phaeton.artisoft.com> References: <199509190433.WAA24091@rocky.sri.MT.net> <199509191852.LAA10314@phaeton.artisoft.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Terry Lambert writes:
> > > 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.
> > > On the other hand, if I want block profiling without having to rewrite
> > > the compiler, then I have to add a block start on function entry and
> > > one on every function exit. If there is one function exit, then I
> > > have to add one.
> >
> > Again, what this has to do with you using goto's I have no idea.
>
> 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." */
> > A rule enforced in all software houses I've worked in. "Programmers who
> > use gotos will be publically ridiculed"
>
> 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.
Nate
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509191905.NAA25538>
