GOTO Pros/Cons

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

Hello,

I've used GOTO in various languages and this is my summation
of my experiances with GOTO.

[1]
If i am writing a program for the first time, or a complete
rewrite, i dont use GOTO.  Granted, it would be nice to be
able to break out of a deeply nested code section with a 
GOTO, but it's not too bad to do without it.

[2]
On the other hand, if i am translating a big program that already
has GOTO's in it, it means rewriting the whole thing just about.
I had a program once that i really liked which used GOTO's and
it ran just fine without any bugs.  When i went to translate it
to Euphoria, i found out how hard it can be to go from a language
that uses GOTO's to a language that doesnt.  It took at least three
days to get something new up and running.
In the end, i can say that the newer version is better, but it
did require a complete rewrite.
Was it worth the effort?
It's hard to say, because the program needs another update now smile
to bring it up to Windows more recent standards.

In retrospect, it looks like it would have been faster to 
be able to translate the program on a 'line by line' basis, 
rather then have to restucture the whole program completely.
(If a language has GOTO's this is possible usually).


[Conclusion]
In the long run, i'd be 'pro' GOTO if there was a way to limit
it's use somehow, or only use it when translating a program 
written in a language that already has GOTO's.
I cant see using GOTO's in new codings because it makes things
too hard to follow later on when you go to update the program.
The structure of the resulting program usually isnt that great
either.
Perhaps a translator would be in order here, to take the
program that was written in one language and convert it into
Euphoria.  Is that possibly with a lot of GOTO's in it though?


Take care for now,
Al

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

Search



Quick Links

User menu

Not signed in.

Misc Menu