Re: Another IDS Feature Request
Posted in 2006
Art S. Kagel said that using goto to exit deeply nested blocks on error is more elegant than testing condition variables, and that he uses globals only with a warning comment. The rest of the thread was a joking tangent about assembly JSR versus GOSUB, different assembly languages and COBOL ALTER. No technical outcome.
Topics: General Discussion
Michael Segel wrote: > Art S. Kagel wrote: > Gee Mr. Kagel, such a mensch. Ahh, shucks Mikey. 8-P > BTW, if you have to use a GOTO and I don't mean JSR in assembler, your > solution is neither elegant nor worth repeating. ;-) There's nothing elegant about having to test a condition variable at each level of a deeply nested logic structure to exit the block on an error condition. I think that it is more elegant to 'goto error_exit;' instead. Do I do that to shortcut out of a single block? No! And I'll go so far as to scratch my wrist with my belt loops, but I'm not twisting my code to scratch my ear on my shoelace. > Yes, you should minimize your use of globals, but that doesn't mean don't > use globals when they make sense. Agreed. I DO use globals when it makes sense, I just think twice about it and normally leave myself a comment like /* GLOBALS - I hate these things. */ as a reminder to keep them from getting out of hand later. > But hey, what do I know? > I believe that a little Mishigas never hurt anyone. I won't argue. Art S. Kagel > <SNIP>
Michael Segel wrote: >> BTW, if you have to use a GOTO and I don't mean JSR in assembler, your >> solution is neither elegant nor worth repeating. ;-) Technically, (Read as, I am just trying to stir up trouble ;-) ) JSR is not a goto in assembler but a GOSUB because it pushes the address of the next instruction after the JSR on the stack before it jumps so that a RET can pop it off of the stack at the end of the routine to start executing where the JSR had left off.
bozon wrote: > Michael Segel wrote: > >>>BTW, if you have to use a GOTO and I don't mean JSR in assembler, your >>>solution is neither elegant nor worth repeating. ;-) >> > > Technically, (Read as, I am just trying to stir up trouble ;-) ) JSR is > not a goto in assembler but a GOSUB because it pushes the address of > the next instruction after the JSR on the stack before it jumps so that > a RET can pop it off of the stack at the end of the routine to start > executing where the JSR had left off. > Aha! but are you and Uncle Mikey talking about the same assembly language? ;-) -- Ciao, Marco ______________________________________________________________________________ Marco Greco /UK /IBM Standard disclaimers apply! Structured Query Scripting Language http://www.4glworks.com/sqsl.htm 4glworks http://www.4glworks.com Informix on Linux http://www.4glworks.com/ifmxlinux.htm
"bozon" <curtis@crowson1.com> wrote in message news:1138720786.210494.138470@g47g2000cwa.googlegroups.com... > Michael Segel wrote: > >> BTW, if you have to use a GOTO and I don't mean JSR in assembler, your > >> solution is neither elegant nor worth repeating. ;-) > > Technically, (Read as, I am just trying to stir up trouble ;-) ) JSR is > not a goto in assembler but a GOSUB because it pushes the address of > the next instruction after the JSR on the stack before it jumps so that > a RET can pop it off of the stack at the end of the routine to start > executing where the JSR had left off. > Hummm --- sounds like a COBOL alter statement to me.... ;-)
Marco Greco Said> >Aha! but are you and Uncle Mikey talking about the same assembly language? ;-) I thought there was only one kind, MC6809 ;-) http://www.techheap.com/processors/6809/6809.html