Re: goto: it's conceded

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

ken mortenson wrote:
> 
> To be explicit, in case I wasn't clear (which I wasn't!!!)...
> 
> Without labels or GOTOs becomes...
> 
> procedure example()   
>   while cond2 do
>     ...
>     while cond3 do
>       ...
>       if cond4 then
>         ...
>       end if
>       if abc then return end if
>     end while
>   end while
> end procedure
> 
> while cond1 do
>   ...
>   example()
> end while
> 

Have you considered the speed diffences? The variables that while cond2, cond3,
etc... need to access from the original calling function? Add all of that in a
real world example and calling a function many times is more complex and much
slower than a properly formed loop. Now, do not get me wrong, loops can often be
nested way to deep and instances where a loop only does one thing with one
variable, is not really time sensitive, then a function call would be fine but
not all loops are that way.

--
Jeremy Cowgar
http://jeremy.cowgar.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu