Re: Open Source

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

jacques deschĂȘnes wrote:
> 
> Don't make it a religion.  "Goto" is not the devil.  By the way in assembler
> there is only "goto" 
> conditional ones like those that jump to a label if some flag is set or unset
> and unconditionnal jump.  Even at call to subroutine is a goto preceded by som
> push an registry saving.
> 
> There is a place for "goto", with or whitout "goto" a good coder stay a good
> coder and a bad one, a bad one.
> 
> 
> Jacques D.

Hi there,



The Curse of the Goto


I have to disagree here.  A bad 'coder' stays a bad coder with the continued
use of gotos, but he/she gets better without the use of the goto.

I used to think that gotos should not be used by beginning programmers
until they have done a significant body of code, and then they will have
the experience to realize the benefits and pitfalls.  I might be changing
my stand on this however, because who can say that at the end of the
day when they run into a big structuring problem, that they dont stick
in a goto somewhere where it really shouldnt be?  "I'll get back to
restructure that section of code at a later date, soon".  Then another
goto, then another, then another.  It's too tempting sometimes to 
stick in a goto rather than restructure a whole section of code.
Restructure might take hours, a goto maybe 10 seconds...who here can
fight that urge each and *every* single time this comes up?
If you have the discipline to use gotos only inside a loop or within
a short body of code alone where the readability actually gets better,
then good for you.  Many wont be able to do this when faced with a tough
dilemma that gets solved in a flash with a single (and ill placed)
goto.  Sometimes the fastest way home is not the safest.

If this doesnt convince or at least show the main reasoning behind
the pitfalls of the goto, then i will shut up and allow you to take on
the Curse of the Goto for as long as you like.  Use gotos as freely
(or not) as you like, but when the Curse of the Goto rears up and bites
you on the backside, dont come back and claim that nobody warned you.


Take care,
Al

E boa sorte com sua programacao Euphoria!


My bumper sticker: "I brake for LED's"

 From "Black Knight":
"I can live with losing the good fight,
 but i can not live without fighting it".
"Well on second thought, maybe not."

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

Search



Quick Links

User menu

Not signed in.

Misc Menu