Page 2 of 4

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

Posted: Fri Jul 31, 2009 8:23 pm
by Jenk
I'm baffled as to why anyone thinks this is a step forward.

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

Posted: Fri Jul 31, 2009 8:34 pm
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.

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

Posted: Fri Jul 31, 2009 10:06 pm
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.

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

Posted: Sat Aug 01, 2009 2:17 am
by jaoudestudios
Glad I am switching to Ruby & Ruby on Rails :lol: , even after all this time!

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

Posted: Sat Aug 01, 2009 6:36 pm
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 :)

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

Posted: Sun Aug 02, 2009 10:28 am
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!

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

Posted: Mon Aug 03, 2009 7:38 am
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:

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

Posted: Mon Aug 03, 2009 12:20 pm
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

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

Posted: Tue Aug 04, 2009 1:34 am
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:

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

Posted: Tue Aug 04, 2009 4:27 am
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.

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

Posted: Tue Aug 04, 2009 3:45 pm
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.

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

Posted: Tue Aug 04, 2009 3:58 pm
by Benjamin
I want to see a framework written with nothing but goto statements and no decomposition.

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

Posted: Tue Aug 04, 2009 4:50 pm
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

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

Posted: Tue Aug 04, 2009 4:58 pm
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?

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

Posted: Tue Aug 04, 2009 6:44 pm
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.