Re: Why is GOTO bad?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



But I realise what you are saying: It is not extendable and a scheme with
BREAK label or BREAK n is more flexible working with _ALL_ types of loop.
Having said that, what real difference is there between "BREAK label" and
"GOTO label"? Nothing at all.

That's not true. With break label you can't accidentally jump inside
another loop, which is the reason goto is considered bad I believe (I'm no
computer scientist).

Good point. I forgot about that. Well all my uses of GOTO are to jump out,
never to jump in. It is always to escape something.
So in that sense, this use of GOTO is disciplined.

Stephen Howe


.



Relevant Pages

  • Re: how to emulate goto.
    ... but 'continue break label' is not really a goto. ... developers rather than poor tools. ...
    (comp.lang.java.programmer)
  • Re: Why is GOTO bad?
    ... For people who don't like GOTO, it is an existing real option. ... BREAK label or BREAK n is more flexible working with _ALL_ types of loop. ...
    (microsoft.public.vb.general.discussion)
  • Re: Java needs "goto" (was Re: hi)
    ... There are situations where "goto" would be very useful, ... An alternative to "break label" since label is currently limited in ... it always seems to make the code confusing. ... are confusing because the programmer (having labelled break available) didn't ...
    (comp.lang.java.programmer)
  • Re: Java needs "goto" (was Re: hi)
    ... To depend on exceptions as flow control is a bad practice. ... This typically occurs because the reserved word "goto" isn't implemented. ... An alternative to "break label" since label is currently limited in where it can be located ...
    (comp.lang.java.programmer)
  • Re: Iteration in lisp
    ... state machine is just a tagbody and goto. ... But if you need to change the state-transition-matrix in the middle ... loop and either table-driven or separate-functions for defining the ... (tagbody state1 (trace-state1 aux) ...
    (comp.lang.lisp)