Qbasicnews.com
About using GOTO . . . - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html)
+--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html)
+--- Thread: About using GOTO . . . (/thread-373.html)

Pages: 1 2 3 4 5 6 7 8 9


About using GOTO . . . - oracle - 03-24-2003

Sorry nathan, I didn't mean loops although thats what it says. I meant SUB CALLS. :oops: If you are in 27 nested SUBS you have stack problems, 'cause you've gotta exit the sub properly. The *real* bad thing (as opposed to the other bad thing that isn't) is qbasic is a sub being able to call itself. I had huge troubles with this when I was a newbie writing a tamagotchi styles game. But I'm not that new anymore. Maybe this is the reason that newbies complain that they get stack errors...


About using GOTO . . . - na_th_an - 03-24-2003

You're right... but HOW CAN YOU EXIT NESTED SUB CALLS WITH A GOTO? :o

But I've taken your point Smile


About using GOTO . . . - oracle - 03-24-2003

I have a dream... That everyone in the world can write code without GOTOs, so others can understand it. Glenn, the point of this is, what if you get stuck trying to do something *really* complicated? Then you need help, you show someone your source, and because we don't all have 100 gHz processors in our heads with 40 gHz RAM :rotfl: we can't help out?

This is only for really tricky programs. I'm sure most of us could follow all the simple gotos.

ps: do you extensively test all your GOTO progs to make sure they work fine? Like, every part??


About using GOTO . . . - Blitz - 03-24-2003

Someone lock this thread, mmkay?
I can't stand all this propaganda for goto.

goto hell

hell:
print "mmkay?"


About using GOTO . . . - oracle - 03-24-2003

Heey, a supporter! Big Grin

Lets all gang up on Glenn! Big Grin


About using GOTO . . . - Hexadecimal Disaster - 03-24-2003

Quote:
Code:
goto hell

hell:
print "mmkay?"

[Image: rotfl.gif]


About using GOTO . . . - wizardlife - 03-24-2003

Quote:Someone lock this thread, mmkay?
I can't stand all this propaganda for goto.

goto hell

hell:
print "mmkay?"

lol. Blitz is a pain the ass when he disagrees and really funny otherwise...

I can't believe C has a goto... that's so wierd. I'd never actually used it, just c++. But pascal certainly doesn't have a goto... and I don't think Turing does either. (and that was the one meant for teaching)

Folks who don't indent: How do you read your own code? I'd never nest more than two or three loops anyways, and I set it to indent to like the 3rd space.


About using GOTO . . . - Agamemnus - 03-24-2003

Quote:Folks who don't indent: How do you read your own code? I'd never nest more than two or three loops anyways, and I set it to indent to like the 3rd space.

I either don't HAVE more than 3 loops OR I use commented loops.......


People unqualified to be programming shouldn't be... - Glenn - 03-24-2003

doing it. And of course I test all my GOTO programs! The GOTOs make them easier to test. The last headache I had with a missing END IF was enough to make me avoid those hideous things forever.

And if you had read anything, you'd see that I've already addressed your "point". I don't write computer programs for *people* to read. (That's not what computer programs are for.) When I write for people, I write a report. The idea that I should make my work harder to make someone else's easier is completely ludicrous.



Quote:I have a dream... That everyone in the world can write code without GOTOs, so others can understand it. Glenn, the point of this is, what if you get stuck trying to do something *really* complicated? Then you need help, you show someone your source, and because we don't all have 100 gHz processors in our heads with 40 gHz RAM :rotfl: we can't help out?

This is only for really tricky programs. I'm sure most of us could follow all the simple gotos.

ps: do you extensively test all your GOTO progs to make sure they work fine? Like, every part??



I don't understand how you read code when it... - Glenn - 03-24-2003

*is* indented. (I didn't learn to read diagaonally.) The first thing I do when I get indented code is run it through my handy dandy code unindenter.

"Folks who don't indent: How do you read your own code? "