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
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

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

Post by Jenk »

I'm baffled as to why anyone thinks this is a step forward.
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 »

I truly don't understand why this was added either. From what I have read it seems like a majority were against it, didn't see a real need for it, but added it anyway. goto leads to read only code. Suitable replacements have been added to most languages rendering it outdated and unneeded. (try/catch, switch, while, do while, even functions).

The only real reason I see to add this to PHP is to increase the distance between poor code and high quality code, making them easier to differentiate.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

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

Post by Eric! »

Sheesh. I remember when it was impossible to write a program without goto. In fact when assembly was the only language and compilers were almost non-existant, I used to wear out the dissassembler hot key for following JMP $XXXX commands. Now to think that such a basic machine instruction is so completely hidden in the depths of the box to where it is considered poor programming. What a world.

Now there are structures, classes, objects, overloading and strange lingo I barely recognize as English. Now give me a goto and I know exactly what it is doing. :mrgreen:

Nevermind the last time I used something even close to a goto (JMP in assembly) was writing microcontroller code without a compiler about 15 years ago.
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 »

Glad I am switching to Ruby & Ruby on Rails :lol: , even after all this time!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

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

Post by John Cartwright »

Eric! wrote:Sheesh. I remember when it was impossible to write a program without goto. In fact when assembly was the only language and compilers were almost non-existant, I used to wear out the dissassembler hot key for following JMP $XXXX commands. Now to think that such a basic machine instruction is so completely hidden in the depths of the box to where it is considered poor programming. What a world.

Now there are structures, classes, objects, overloading and strange lingo I barely recognize as English. Now give me a goto and I know exactly what it is doing. :mrgreen:

Nevermind the last time I used something even close to a goto (JMP in assembly) was writing microcontroller code without a compiler about 15 years ago.
Oh boy am I glad I am young enough to never have encountered a goto statement :)
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 »

I've programmed in Assembly before too, that's the only time I've used a jump or goto.

They have included goto's just as an extra feature to give programmers more freedom. If you don't like it, don't use it. If you have to modify code which uses it - then tough!
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

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

Post by Eric! »

GOTO isn't the end of the world, but I don't know why anyone would use it anymore. It would be interesting to hear from the people who lobbied to get it put into PHP.

Just be glad they didn't bring back the precursor to functions: GOSUB :lol:
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'd advise anyone who did not read original Dijkstra paper to read this annotated variant: http://david.tribble.com/text/goto.html
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

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

Post by JAB Creations »

Is it so difficult to do...

Code: Select all

<?php if (arg) {ex_this_function();}?>
...?

I remember goto statements, just not the language I learned (and forgot) in high school.

Was there any real point to adding it? I mean this seems beyond a waste of time...the last thing I'd want to do is worry about pushing code down lines simply because it'll break a goto statement. :roll:
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 »

JAB Creations wrote:the last thing I'd want to do is worry about pushing code down lines simply because it'll break a goto statement. :roll:
Shows that you didn't take your time to even read the docs. PHP has labeled goto, so pushing code down is not a problem.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

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

Post by josh »

Would much rather have [proper] lambda. And Jab, no. I would rather use objects to control my execution thru composition :-) I'm sure some people would rather use the goto too.
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 »

I want to see a framework written with nothing but goto statements and no decomposition.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

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

Post by josh »

Anyone see the link to xkcd? http://xkcd.com/292/

and when you say a framework "written with nothing but" I am confused ( because I was going to write an absurdly basic framework in the simplest form of the word to humor you ;-) ).... but, am I allowed to use other constructs, like echo? A program isnt much of a program as much as it is an infinite loop or immediately terminating script if it can't do anything but control flow, there has to be some other constructs used like inputs & outputs, surely goto could be used within a method of a class, would that qualify? :D
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 »

josh wrote:Would much rather have [proper] lambda.
By 'proper' you mean catching variables in the current scope into a closure without having to declare the list of variables explicitly?
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 »

josh wrote:and when you say a framework "written with nothing but"
Ha, how about anything goes except user defined functions, classes, switches, while, do while, for and foreach loops.
Post Reply