Dennis,
I make a point of (generally, not always) having a subroutine called return.
In my code, I will code an 'exsr return' instead of simply the RETURN
opcode, even though the 'return' subroutine may contain no more than the
RETURN op-code.
Why?
It's my preferred way of doing things. Sometimes, there is cleanup to be
performed, completion messages to be sent, files to be closed, return codes
to be set. Yes, I could have these lines of code duplicated throughout the
program, immediately prior to a RETURN statement, but that means
duplication, which means more chance of errors.
As Joe said in an earlier post, we each have our way of doing things, which
may not immediately be clear to others, but which may well have benefits
which they don't immediately see. Once I explain my method to other
developers, they often decide to use it, since if they subsequently add code
which may require an exit from the program, they can simply say 'EXSR
RETURN' and *know* that all required return processin will be performed.
Yes, it hides the RETURN from the maintainer more effectively - THAT'S THE
WHOLE POINT.
Be careful of calling things lazy and ugly.
Rory
On Tue, Mar 2, 2010 at 2:24 AM, Dennis Lovelady <iseries@xxxxxxxxxxxx>wrote:
And as far as that EXSR GET OUTNOW argument... that just hides the RETURN
from the maintainer more effectively. It is lazy, ugly, and asking for
trouble down the road (when the author is at some other job, creating new
problems for new followers).
As an Amazon Associate we earn from qualifying purchases.