Re: Good Use of GOTO

new topic     » goto parent     » topic index » view thread      » older message » newer message

Lucius L. Hilley III wrote:
> 
> c.k.lester wrote:
> > 
> > Lucius L. Hilley III wrote:
> > 
> > > for t=1 to 10 next
> > >   if a then
> > >     goto "t_continue"
> > >   else
> > >     -- code
> > >   end if
> > >   label "t_continue"
> > > end for
> > 
> > Good job, Lucius! :) This solidifies my opinion that GOTO is unnecessary.
> > The example just using 'continue' is cleaner, and it's probably faster
> > without GOTO (one less jump?).
> 
> We need goto to be able to jump out of a loop early.
> Redundant if statements are such a pain.
>   Lets add exit to avoid adding goto.
> 
> We want need goto to leap back to the beginning of a for
> loop and keep the index value the same.  We are now trying
> another approach, we changed something else.
>   Lets add retry to avoid adding goto.
> 
> We want need goto in order to proceed through a loop without
> executing any following code within the loop before starting
> the next iteration.
>   Lets add continue to avoid adding goto.
> 
> 
> MORE keywords are CLEANER than one easy to understand KEYWORD?
> 
>     Lucius L. Hilley III - Unkmar

Generally, yes. Because they have context.

There is a point of diminishing returns though (no pun intended).

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu