The book "Code Complete 2ed" agrees. Yes it is published by M$ and is about c/s programming. But it has a good view of good programming practices, many of which are applicable globally.
The ability to define constants w/o defining storage is one of the features which makes HLASM more user friendly than Cobol. IBM Mainframe Assembler List <[email protected]> wrote on 11/15/2012 12:48:37 PM: > From: "McKown, John" <[email protected]> > To: [email protected], > Date: 11/15/2012 01:00 PM > Subject: Re: the fun of coding in HLASM > Sent by: IBM Mainframe Assembler List <[email protected]> > > I may be the lone voice of dissent on this. I really don't like > "magic values" and rarely like literals. In the case given > > > IC R0,=AL1(1,0,2,3,4,0)(R7) > > In my "weirdness", I might code this like: > > IC R0,&UNDERSTANDABLE_NAME(R7) > > Where &UNDERSTANDABLE_NAME would be a SETC or GLBC symbol set at the > beginning of the code: > > LCLC &UNDERSTANDABLE_NAME > &UNDERSTANDABLE_NAME SETC '=AL1(1,0,2,3,4,0)' > > The same with other literals. Use a SETC symbol with a good name and > use it instead of the "magic value". In order to "gross out" > everybody, I do the same in C with #define > > -- > John McKown > > -----Original Message----- > > On 15 November 2012 10:12, Rob van der Heij <[email protected]> wrote: > > > > > If you care to undo the effect of more readable constants, you could > > do this :-) > > > CLC =X'58F0,0014,58FF'(R6),0(R6) > > > > Yuck! :-( Isn't there an assembler option that will catch this? > > Perhaps if R6 is defined as > > R6 EQU 6,,,,GR > > or the like? > > > > > I recently used the following, and thought was pretty cool > > > IC R0,=AL1(1,0,2,3,4,0)(R7) > > > > Sure - that's both cool and readable. > > > > Tony H. ----------------------------------------- The information contained in this communication (including any attachments hereto) is confidential and is intended solely for the personal and confidential use of the individual or entity to whom it is addressed. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this communication in error and that any review, dissemination, copying, or unauthorized use of this information, or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. Thank you
