The sky is falling, the sky is falling!!

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

The sky is falling, the sky is falling!!

Post by pickle »

PHP now has GOTO: http://ca.php.net/goto

Ugh.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: The sky is falling, the sky is falling!!

Post by jaoudestudios »

Is this new?

I have not used goto in about 10 years and I am glad!
User avatar
arjan.top
Forum Contributor
Posts: 305
Joined: Sun Oct 14, 2007 4:36 am
Location: Hoče, Slovenia

Re: The sky is falling, the sky is falling!!

Post by arjan.top »

old =P
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: The sky is falling, the sky is falling!!

Post by jackpf »

Gotos are stupid.

They confuse the <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span> out of people trying to understand others' code.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: The sky is falling, the sky is falling!!

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: The sky is falling, the sky is falling!!

Post 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? :P
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: The sky is falling, the sky is falling!!

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: The sky is falling, the sky is falling!!

Post 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.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: The sky is falling, the sky is falling!!

Post by jayshields »

Now where did that obfuscated code challenge thread go...
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: The sky is falling, the sky is falling!!

Post 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... :)
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: The sky is falling, the sky is falling!!

Post by Benjamin »

Does anyone have any links to the arguments presented for and against adding this and the discussion that followed?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: The sky is falling, the sky is falling!!

Post by Eran »

User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: The sky is falling, the sky is falling!!

Post by jackpf »

http://xkcd.com/292/

That is hilarious.

Sorry for re-posting.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: The sky is falling, the sky is falling!!

Post by Benjamin »

Thanks pytrin. I meant between the developers of PHP.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: The sky is falling, the sky is falling!!

Post 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.
Post Reply