I realize that it takes up room on a page/screen, but there is an option to display active USINGs, and that makes it easier to catch certain types of errors.
Defensive programming is your friend, in any language. I'm not convinced that it's any easier to shoot yourself in the foot with HLASM than with, e.g., FORTRAN IV. Each language has its own pitfalls. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Assembler List [[email protected]] on behalf of Steve Smith [[email protected]] Sent: Friday, June 2, 2023 11:07 AM To: [email protected] Subject: Re: Assembler theology question On Thu, Jun 1, 2023 at 10:25 PM Phil Smith III <[email protected]> wrote: > See, I knew this would get into theology! > > > > I guess I wasn't clear enough: I only meant this for when you're doing a > single instruction, something that will never expand-this > kind of "flyby" of a control block on the way to another. Clearly if > you're doing a bunch, it makes more sense to do the USING. > > > > What I meant about "keeping out of trouble" is that if you make a change > later and decide to use one of the registers as a base > semi-globally, then having this single-line USING makes for a larger > change. Of course you'll argue (and I'll agree) that this might > be good, as it might keep you from stepping on that base, so I guess that > doesn't really apply. > This shouldn't be an issue. You should always DROP when the code that was written for is done with it. Leaving hanging USINGs that may or may not be valid anymore certainly is looking for trouble. So, now we're talking about 3 statements vs. 1, and I think that tilts the answer towards the 1-instruction form. But I agree with most of the comments about how it depends on various other considerations. imho, I tend to use the one-line version for common things, but I like USINGs for more exotic control blocks. > > > > Jeremy's comment about typos is certainly an interesting point, though > it'll likely come clear pretty fast once run! I'm not sure > that three lines of code vs. one represents a net savings in potential > typos, either, TBH. > Yeah, you could typo the USING just as easily as the instruction reference. > > > > I sure do love assembler. > I'm going to presume you mean that both literally and ironically (I agree dually). While you can write gibberish in any language, only assembler opens up the myriad possibilities of screwing up register usage. sas
