[797] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: exception handling...

daemon@ATHENA.MIT.EDU (Fri Sep 1 13:31:08 1995 )

From: bellegj@monitor.cs.orst.edu
To: coldstuff@MIT.EDU
In-Reply-To: Your message of "Fri, 01 Sep 95 10:44:26 PDT."
Date: Fri, 01 Sep 95 10:27:34 PDT

> hmm... puts the successful case at the bottom instead of the top --
> one expects the successful case most of the time (that is, success is
> the typical case), and doesn't want to skip over a bunch of border
> cases to reach the code for the typical case.
> Gets a minus for readability IMHO.
> Chuck

Actually, it's normal to put the specific cases first and the general last.
When is the last time you wrote a switch with the default first?
The reason is that it's easier to visually jump to the end of a body od code
than to dig something out of the middle.

-- Jeff Bellegarde (bellegj@mail.cs.orst.edu)