Re: When it comes to GOTOs...

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

>no, they're actually good. Suppose you have this section of the
>program you want to do at certain times, but a procedure wouldn't do
>the trick. You use line numbers.


Well.... Sometimes you just need an example, because I can't think of any
time a lack of a GOTO can be any more than a slight inconvenience.

I used to think that GOTOs were needed, and that sometimes there was no
other clean way to get around it... How wrong I was! Before learning
Euphoria, and becoming proficiant in loops, I was using GOTOs like mad in
QBasic. I now look at my unstructured code and shudder. The use of GOTOs
were used everytime I added a new feature to a BBS Door type game
(Unregistered Alpha version, of course ;) Now, I'm having a lot of
trouble trying to untangle the code in order to add anything else, and
convert it to Euphoria.

As I slowly move the stuff to Euphoria, creating procedures and functions
instead of GOTOs, using if blocks (Also unknown to me for quite some time
with Qbasic) and while loops, and it is so much cleaner!

The point is, to me, a GOTO breaks the flow of the program, requiring you
to jump somewhere else in the code adrubtly, with all the chaos of trying
to figure out what variables you've already assigned, which ones aren't,
which ones need to be reassigned, trying to figure out what can jump to
it, wondering how to get back to where you were (oh no, another GOTO!).
They are like cancer, you get one, and you all of the sudden need more,
and pretty soon, your code is tangled worse than the cables behind your
computer . . .


___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

Search



Quick Links

User menu

Not signed in.

Misc Menu