Skip to main content
gamedev.net
🔒 Locked

goto command

Started by BOOGIEMAN Oct 10, 2005 at 6:46 PM 5 replies 1k views
Original Post
BOOGIEMAN
BOOGIEMAN
I wonder if any scripting language supports goto command ? I looked in Python and Ruby and they doesn't. Are there any that does ?
Ra
Ra
Many do (BASIC comes to mind)... but why?

You can do anything you can in the other languages without using goto. That's why it's not there, because they don't need it.
Ra
BOOGIEMAN
BOOGIEMAN
I know they don't need it, but I do. I just want to know which programming languages has goto and which don't ?
dave
dave
basic and C do.

Although maybe you should be asking yourself why you need to use goto.

ace
BOOGIEMAN
BOOGIEMAN
Quote:
Original post by ace_lovegrove
basic and C do.

Although maybe you should be asking yourself why you need to use goto.

ace


Because I'm an amateur programmer.
I know about C, C++, C# ... supports goto, but I didn't know that none of those hundereds scripting languages supports it
Tesl
Tesl
Quote:
Original post by BOOGIEMAN
Quote:
Original post by ace_lovegrove
basic and C do.

Although maybe you should be asking yourself why you need to use goto.

ace


Because I'm an amateur programmer.


lol, then you definitely shouldnt be using it...

Its actually an interesting question though. It just dawned on me that iv no idea, since iv never had to use a goto before in my life (except some error handling in C)
"Leave it to the computer programmers to shorten the "Year 2000 Millennium Bug" to "Y2K." Isn't that what caused this problem in the first place?"
Dobbs
Dobbs
Quote:
Original post by BOOGIEMAN
Because I'm an amateur programmer.


That's not a reason to use goto statements.

Quote:
I know about C, C++, C# ... supports goto, but I didn't know that none of those hundereds scripting languages supports it


Most people will tell you a goto is rarely useful. The only place I can remember seeing gotos is Visual Basic error handling code, and it was basically a hack to make up for VB's lack of exceptions (although this may have changed in newer versions).

You can probably do the same thing you want with gotos by using some other language feature.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.