In a recent note, McKown, John said:
> Date: Mon, 18 Jul 2005 08:26:49 -0500
>
> > -----Original Message-----
> > From: IBM Mainframe Discussion List
> > [mailto:[log in to unmask]] On Behalf Of Bill Fairchild
>
> > And why is LH r,FIVE with FIVE DC H'5' worse than atrocious?
>
> Well, why is FIVE a "magic number"? If you're going to go to the
> "trouble" of using a variable, name the variable so that somebody else
> knows what it is, conceptually. You should do something like:
>
> SIZE_OF_ENTRY DC H'5'
>
> or
>
> NUMBER_OF_INITIAL_ELEMENTS_IN_ARRAY DC H'5'
>
I prefer even one more indirection to minimize the possibility
of multiple uses of self-defining terms:
SIZE_OF_ENTRY_VALUE EQU 5
Then, either (or all, as desired):
LA r,SIZE_OF_ENTRY_VALUE
or:
LH r,=Y(SIZE_OF_ENTRY_VALUE)
or:
LH r,SIZE_OF_ENTRY
...
SIZE_OF_ENTRY DC Y(SIZE_OF_ENTRY_VALUE)
As for "FIVE", the worst I've ever seen (in IBM code, in fact), was:
FIFTYSIX EQU 56 * Number of bytes in a TXT record
and the same program had (roughly), nicely:
NROWS EQU 24 * Rows in matrix
but, then,
MH =Y(NROWS) * Multiply by 24
In a user mod, I needed to change the value of NROWS. Would have
been a lot easier except for the wretched comments.
-- gil
--
StorageTek
INFORMATION made POWERFUL
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html