Page 1 of 4
The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 10:00 am
by pickle
PHP now has GOTO:
http://ca.php.net/goto
Ugh.
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 10:03 am
by jaoudestudios
Is this new?
I have not used goto in about 10 years and I am glad!
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 10:03 am
by arjan.top
old =P
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 10:35 am
by jackpf
Gotos are stupid.
They confuse the <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> out of people trying to understand others' code.
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 11:36 am
by pickle
Actually it was just enabled in PHP 5.3, which was released at the end of June. I wouldn't say it's old news.
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 11:43 am
by alex.barylski
GOTO;s are just another language tool, abusing them, like anything, will result in bad code, GOTO are exceptionally bad because of the never ending jumping that occurs, but still, then can be handy in very limited situations.
They are an experienced programmers tool...
Someone should build a language with every bell and whistle but only publically document like the smellest subset of the language to make it useful, then invite only those who pass a test, something of a programmers version of the stone cutters or whatever those people were on the simpsons -- secret cult thing -- shriners maybe?

Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 11:57 am
by pickle
The GOTOs in PHP aren't full-fledged, program jumping messes. You can only GOTO a label inside the same function - so it's not too bad.
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 12:14 pm
by jackpf
True...but I have never, ever needed to use one. Surely a logical if, else statement would achieve the same thing, and would actually be possible to understand without searching the file for various labels and whatnot.
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 12:18 pm
by jayshields
Now where did that obfuscated code challenge thread go...
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 1:29 pm
by alex.barylski
The GOTOs in PHP aren't full-fledged, program jumping messes. You can only GOTO a label inside the same function - so it's not too bad.
i seen that in the link...

Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 1:43 pm
by Benjamin
Does anyone have any links to the arguments presented for and against adding this and the discussion that followed?
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 1:58 pm
by Eran
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 3:10 pm
by jackpf
http://xkcd.com/292/
That is hilarious.
Sorry for re-posting.
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 3:44 pm
by Benjamin
Thanks pytrin. I meant between the developers of PHP.
Re: The sky is falling, the sky is falling!!
Posted: Fri Jul 31, 2009 7:45 pm
by Weirdan
I guess it dates back to 2005, when labeled breaks were discussed. I guess you can start with this message:
http://marc.info/?l=php-internals&m=113280846017379&w=2 and follow the thread. Be sure to search maillist archive for 'goto' as well, there were several threads about it.