In a recent note, Alan Altmark said:

> Date:         Tue, 7 Nov 2006 00:04:23 -0500
> 
> Best practice:  MVC TARGET(6),=XL6'402021212121'
> Note the length modifer.  This surfaces both the exact length of the
> source and the exact length of the move.  People who omit the length
> modifer are sentenced to the 9th level of hell for all eternity.  Or even
> longer.
> 
I disagree strongly with the concept of such "surfacing".  It
detracts from maintainability and requires the coder to bear in
mind microscopic details throughout the program.

Better:

SOURCE   DC    XL6'402021212121'
         ...
         MVC TARGET(L'SOURCE),SOURCE

Eschew pleonastic use of self-defining terms.  (And a conscientious
assembler (HLASM isn't) would warn if the source item overruns the
size of the target field.)

I once was assigned to ugrade a program where the original
coder had conscientiously coded such as:

NROWS    EQU   16  Number of rows in matrix

Then tragically spoiled it by repeatedly:

         MH    =Y(NROWS)  Multiply by 16

Apparently satisfying a "house rule" that every statement must
bear a comment.  The verification seems to have been mechanical:
some of the comments were nonsensical, even just a single '.'

Etc.  Guess what?  I needed to increase NROWS, and where I might
have been able to change a single EQU if my predecessor had been
responsible, I had to ferret out all the affected comments and
change those also.  (Generally, I deleted them; no "house rule".)

The same program also contained:

FIFTYSIX EQU   56

... apparently satisfying a "house rule" that all self-defining
terms be equated.

Good design of OS/360 would have had the sole declaration is
a SYS1.MACLIB member:

DSNLEN   EQU  44  Length of a data set name

And applied occurrences such as:

SAMPLES  DC    CL(DSNLEN)'SYS1.SAMPLIB'  IBM Samples Library

... and it would be possible to increase the length of supported
data set names simply by changing that one EQU and reassembling
z/OS.  (Yah, I know there are concerns of base register reach,
etc.  And existing media would need to be converted.  But still ...)

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

Reply via email to