Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

ZDNet Australia:
If PHP then goto is the future
Jun 11, 2009 @ 19:51:46

With all of the recent talk about GOTO in PHP 5.3, there's been a lot of comments, both positive and negative, about the functionality and the PHP development group's choice to include it. This new article from ZDNet (Australia) looks at the debate that's been going on and provides a more "clueful" perspective.

Few things can spark more religious fervour amongst programmers than the mention of a goto statement. PHP has stepped into the middle of the firefight by announcing that it will be implementing goto functionality in version 5.3. [...] By going against the goto grain, PHP is challenging a tenet upon which the foundation of modern programming is built. [...] Here's a shock for the young, blindly-accepting-articles-of-faith type of programmer that has never had to use a goto: most high-level languages implement a form of goto, you just know them as break, switch and continue.

He agrees with most of the masses that, in the wrong hands (or in the hands of an inexperienced programmer), it could result in some truly horrific code. For some, however, its the open door they've been looking for - jumping out of structures so deep in logic that getting back out has been a major struggle.

tagged: future opinion goto

Link:

php|architect Blog:
GOTO in PHP 5.3: is it Really That Evil?
Jun 11, 2009 @ 15:28:02

From Marco Tabini (on the php|architect blog) there's his look at GOTO, a new feature to be included in PHP 5.3, and whether its a bad/evil thing have in PHP or not. He talks with two developers about its impact.

GOTO in PHP? Is that possible? It turns out that it is. GOTO is poised to make its official debug in the upcoming 5.3 release of PHP—and the comments are flowing around the Net. We caught up with Sara Golemon, who introduced the construct in PHP, and with Timothy Boronczyk, who made one of the rare level-headed comments about its use, to shed some light on how GOTO will affect the world of PHP.

They look at why GOTO was even on the table for inclusion, how it got started in the PHP code (the target was PHP6) why there's so much controversy over it and how, despite what the naysayers say, it will not be the demise of the language and cause some kind of downward spiral in PHP development.

tagged: timothyboronczyk saragolemon evil goto

Link:

Reddit.com:
C'mon PHP. At this point, you're almost a parody of yourself
Jun 09, 2009 @ 21:35:28

Over on Reddit.com today there's an interesting post that kicks off a discussion as to PHP might be a "parody of itself" by making the choice to include "goto" functionality in the upcoming PHP 5.3 release (you can find release candidates here).

If you can manage to overlook the trolling and PHP bashing long enough, though, you'll see an interesting discussion on goto, how its implemented in other languages and even suggestions of how it has proved itself useful in several different languages (C, Lisp, Assembly). If you have the patience to sort through it all, there's some valid points made for both sides of the "goto in PHP" argument - for and against.

tagged: goto reddit parody

Link:

Timothy Boronczyk's Blog:
Goto and Exceptions
Mar 24, 2009 @ 17:57:12

Timothy Boronczyk has written up a nice post about two practical uses of the "goto" syntax in the upcoming PHP 5.3 release of the popular web scripting language.

Yet goto can still be useful under certain circumstances. For example, some programmers use goto to direct the execution flow to dedicated error-handling logic elsewhere in a program in languages that lack exception handling (such as C).

His two examples are to: emulate exception handling in a procedural environment and to overcome perceived limitations with try/catch. He adds in some code comparing the "without goto" and "with goto" versions of the same code showing how the exception handling might be handled differently.

tagged: goto exception oop example trycatch

Link:

PHPImpact Blog:
PHP: Spaghetti alla Bolognese
Jan 09, 2009 @ 17:17:05

On the PHP::Impact blog Federico Cargnelutti has expressed his opinion about the inclusion of the "GOTO" statement into future builds of PHP:

The GOTO statement has been the target of much continued criticism and debate, with the primary negative claim being that use of GOTO results in unreadable and generally unmaintainable spaghetti code. [...] Well, great news. The GOTO statement has just been added to the PHP language and it’s now in the hands of experienced programmers and inexperienced Web developers.

He references a quote from Jeff Moore stating his dissatisfaction with the inclusion of it too. Comments on the post, however, correct Federico on how the "GOTO" in PHP will work - not quite as global as he'd thought.

tagged: spaghetti goto opinion complex

Link:

Johannes Schluter's Blog:
Goto your Christmas presents with PHP 5.3
Jan 06, 2009 @ 16:20:56

Johannes Schluter recently looked at one of the new features coming with PHP 5.3 - the goto functionality:

Over the last few days I already mentioned a few hidden gems from PHP 5.3. Now at Christmas I wanted to take a look at some new language feature of the upcoming PHP version: Added "jump label" operator (limited "goto"). (Dmitry, Sara)

No, its not the sort of "goto" you're thinking of - its a bit more limited than that. Johannes mentions that it only allows you to jump within the same execution unit and you can't jump into loops. Used incorrectly, it can be bad but he points out two useful instances - one being a code generator and the other an instance where you might need to drop out of code but not kill off the script in the process (sample code is included for this second one).

tagged: php5 goto new feature generate error handle

Link:

SitePoint PHP Blog:
PHP6 gets a COMEFROM statement
Apr 01, 2006 @ 02:20:04

Harry Fuecks has posted a new item on the SitePoint PHP Blog today - a look at the "COMEFROM" statement that the next major version of PHP will have (PHP6).

One of the more controversial additions to PHP6 is the GOTO. Some have argued it flys in the face of many years good programming sense but there are valid use cases, when running performance critical operations such as parsing, where the overhead of making PHP user function calls becomes significant.

Anyway GOTO seems to have opened the gates to some more radical language modifications and recent discussion a revolved around adding a COMEFROM statement to PHP, which led to an initial patch being applied to the PHP6 CVS branch here.

The statement allows you to modify your code's behavior based on where it came from rather than just forwarding around bits of code from one place to the next. Harry gives a code example of how it can be used as well.

(Hint: think about this one...)

tagged: php6 comefrom statement goto discussion php6 comefrom statement goto discussion

Link:

SitePoint PHP Blog:
PHP6 gets a COMEFROM statement
Apr 01, 2006 @ 02:20:04

Harry Fuecks has posted a new item on the SitePoint PHP Blog today - a look at the "COMEFROM" statement that the next major version of PHP will have (PHP6).

One of the more controversial additions to PHP6 is the GOTO. Some have argued it flys in the face of many years good programming sense but there are valid use cases, when running performance critical operations such as parsing, where the overhead of making PHP user function calls becomes significant.

Anyway GOTO seems to have opened the gates to some more radical language modifications and recent discussion a revolved around adding a COMEFROM statement to PHP, which led to an initial patch being applied to the PHP6 CVS branch here.

The statement allows you to modify your code's behavior based on where it came from rather than just forwarding around bits of code from one place to the next. Harry gives a code example of how it can be used as well.

(Hint: think about this one...)

tagged: php6 comefrom statement goto discussion php6 comefrom statement goto discussion

Link:


Trending Topics: