Re: The 'goto' debate
- Posted by Euler German <efgerman at myrealbox.com> Feb 07, 2002
- 442 views
On 7 Feb 2002, at 2:32, Kat wrote: To: EUforum <EUforum at topica.com> From: Kat <gertie at PELL.NET> Subject: Re: The 'goto' debate Date sent: Thu, 7 Feb 2002 02:32:16 -0600 Send reply to: EUforum at topica.com > > I worry about those big if-elsif-endif stacks, for other than the careful > indenting, and runtime error checks, i am never sure if 5 pages of such a > stack is going to execute properly. Many times i have printed out the pile, > and > manually checked off matching elsif-elsif indents to be more sure of just what > was going to happen. Besides, with that many in the if-pile, the goto > functioning at a case statement, resolving the possible targets at compile > time, > should be *much* faster for those statements at the bottom of the stack. And > yes, i could have broken each then-clause off to a separate function, except > for > the local var passing back and forth. > Well Kat, I agree with you here. It's *very* difficult (and quite annoying) to handle those stacks. I had the same problem with Clipper but I learned how to handle it. On that time, I was porting a MUMPS application (huge) into Clipper. The first time it was too slow, then it got a lot better and finally it worked as perfect as (or better than). It's still working today though I'm not in charge anymore. I used a debugger (not Clipper's debug) do show open laces or wrong closing. It helped a lot. Of course I had to use too much indentation which quite often force code to side scroll (what I personally hate) but when you have a good editor this is not a problem at all. On other side, unconditional moving (GOTO :LABEL:) will turn it on vertical scroll which is no good either. So, the only way to debug is to hardprint the code to get an overall view. I have no complains on using GOTOs, EXITs, CONTINUEs, IFs..END_IFs, CASEs..END_CASEs or whatsoever. I have been working with so many languages an dialects for so many years that I simply don't care. I just accept the language 'AS IS' and try to get along. Right now, I'm nothing but a (Euphoria) newbie. I'll try it and see if I can get along... Cheers! -- Euler