Raised This Month: $32 Target: $400
 8% 

SourcePawn: goto


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 04-15-2012 , 19:52   SourcePawn: goto
Reply With Quote #1

We all know that SourceMod comes with the so called testsuite folder.
In that folder you can find a file called goto_test.sp.
The funny thing is, if you try to compile it you get this error:
Code:
error 004: function "goto" is not implemented
Anyone know if there was a specific reason why this was removed?

Yours sincerely
Impact
__________________
Impact123 is offline
TheAvengers2
BANNED
Join Date: Jul 2011
Old 04-15-2012 , 20:17   Re: SourcePawn: goto
Reply With Quote #2

Probably since people were making a lot of spaghetti code.
TheAvengers2 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-15-2012 , 20:31   Re: SourcePawn: goto
Reply With Quote #3

I think this sums it up pretty well:

(Source: http://xkcd.com/292/)
__________________
asherkin is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-16-2012 , 13:04   Re: SourcePawn: goto
Reply With Quote #4

I had used goto in AMXX. Nothing bad happened.
hleV is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 04-16-2012 , 18:25   Re: SourcePawn: goto
Reply With Quote #5

Quote:
Originally Posted by hleV View Post
I had used goto in AMXX. Nothing bad happened.
you sure ? the same day you did it, 3 kittens got killed on the street.

You are killing pets !

You can use goto as much as you want, but be sure that any code you release will go straight to the trash section ^^
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
TheAvengers2
BANNED
Join Date: Jul 2011
Old 04-16-2012 , 18:31   Re: SourcePawn: goto
Reply With Quote #6

Quote:
Originally Posted by hleV View Post
I had used goto in AMXX. Nothing bad happened.
Something bad did happen. You're learning a bad programming habit. Depending on how you used this goto, there's a good chance the code won't be reusable and you'll have one heck of a time deciphering what exactly your program is doing months later. Additionally, you're increasing the likelihood of bugs creeping into your code when this happens. Though I do say, here's one one crazy looking goto function.

Last edited by TheAvengers2; 04-16-2012 at 18:47.
TheAvengers2 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode