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

next in thread | previous in thread | raw e-mail | index | archive | help
> > According to a Bell Labs study, human beings are capable of keeping 5 to
> > 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.

> > 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.

> > This "anti-goto-political-correctness-bullshit" has to go.  Anyone who
> > thinks a for loop generates prettier assembly than an label/if/goto
> > had better read more compiler output.
> 
> Huh?  I am in *complete* agreement with David here.  I have looked at
> *thousands* if not *millions* of lines of code in my years in
> programming.  Although there are times when gotos are necessary AND they
> improve readability, they are the exception rather than the rule.  When
> I see two gotos in a single function it is my opinion that the author
> has not spent the time to write the code in a readable manner.  Now,
> there may be a completely valid reason for it, but it will take a lot
> for me to believe that. :)
> 
> 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":


kern/kern_exec.c:execve()
kern/kern_fork.c:fork1()
kern/kern_ktrace.c:ktrace()
kern/kern_physio.c:phsyio()
kern/kern_sig.c:psignal()
kern/kern_synch.c:tsleep()
kern/subr_diskslice.c:dscheck()
kern/subr_diskslice.c:dsopen()
kern/subr_prf.c:kprintf()
kern/subr_prf.c:sprintf()
kern/subr_rlist.c:rlist_free()
kern/sys_generic.c:readv()
kern/sys_generic.c:writev()
kern/sys_generic.c:select()
kern/tty.c:ttyinput()
kern/tty_pty.c:ptcwrite()
kern/uipc_mbuf.c:m_pullup()
kern/uipc_socket.c:soclose()
kern/uipc_socket.c:sodisconnect()
kern/uipc_socket.c:sosend()
kern/uipc_socket.c:soreceive()
kern/uipc_socket.c:sosetopt()
kern/uipc_socket2.c:soerserve()
kern/uipc_syscalls.c:socketpair()
kern/uipc_syscalls.c:sendit()
kern/uipc_syscalls.c:recvit()
kern/uipc_syscalls.c:pipe()
kern/uipc_syscalls.c:getpeername1()
kern/uipc_usrreq.c:uipc_usrreq()
kern/vfs_bio.c:getnewbuf()
kern/vfs_bio.c:getblk()
kern/vfs_bio.c:allocbuf()
kern/vfs_cluster.c:cluster_wbuild()
kern/vfs_lookup.c:lookup()
kern/vfs_lookup.c:relookup()
kern/vfs_subr.c:checkalias()
kern/vfs_subr.c:vfs_hang_addrlist()
kern/vfs_subr.c:vfs_msync()
kern/vfs_syscalls.c:symlink()
kern/vfs_syscalls.c:rename()
kern/vfs_syscalls.c:rmdir()
kern/vfs_syscalls.c:getdirentries()
kern/vfs_syscalls.c:revoke()
kern/vfs_vnops.c:vn_open()

vm/vm_fault.c:vm_fault()
vm/vm_glue.c:scheduler()
vm/vm_map.c:vm_map_copy()
vm/vm_map.c:vm_map_lookup()
vm/vm_mmap.c:vm_mmap()
vm/vm_object.c:_vm_object_page_clean()
vm/vm_object.c:vm_object_copy()
vm/vm_object.c:vm_object_page_remove()

...


					Regards,
					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?199509191852.LAA10314>