> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Bill Fairchild
> Sent: Monday, July 18, 2005 8:15 AM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: Re: Highly used programs: any better replacements out there?
> 

<snip>

> 
> OK, I'll byte (pun intended).  Why is LH r,=H'5' rather than LA r,5  
> atrocious?

If nothing else, lack or locality of reference. I.e. the literal pool
may be in a separate page from the instruction and that page may not be
resident in memory. This causes a __unnecessary__ page fault. And you
still have no idea why the person used "5", unless it is in a comment.
Also, if you need to "zap" the value, this would change the value for
every other instruction which used =H'5', even if the two "fives" were
not conceptually the same thing. I really don't much care for literals
(but I admit to using them).

>  
> And why is LH r,FIVE with FIVE DC H'5' worse than atrocious?
>  
> Bill Fairchild
> 

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'

Yeah, the latter is a PITA to enter (but well beloved by COBOL
programmers). But then, with a really good editor (ISPF doesn't really
count in this case), you could assign a "macro" which the editor would
expand. E.g. a editor which "knows" to expand the "word" NOIEA to
NUMBER_OF_INITIAL_ELEMENTS_IN_ARRAY. I wonder if Eclipse (WSED) does
this?


--
John McKown
Senior Systems Programmer
UICI Insurance Center
Information Technology

This message (including any attachments) contains confidential
information intended for a specific individual and purpose, and its'
content is protected by law.  If you are not the intended recipient, you
should delete this message and are hereby notified that any disclosure,
copying, or distribution of this transmission, or taking any action
based on it, is strictly prohibited.

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

Reply via email to