Edit report at http://bugs.php.net/bug.php?id=48669&edit=1

 ID:                 48669
 Comment by:         phpbugs at ordisante dot com
 Reported by:        iwannalive at hotmail dot com
 Summary:            PHP now includes GOTO
 Status:             Bogus
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   All
 PHP Version:        5.3.0RC4
 Block user comment: N

 New Comment:

Why would you need GOTO for bug handling? We have a wonderful Exception
system.  

It can do everything you want.


Previous Comments:
------------------------------------------------------------------------
[2010-10-08 20:30:31] thehazard at gmail dot com

Seriously, goto is awesome and in some cases, 

very useful and can make the code a lot more clean.



Are bad/unexperienced programmers use 'goto' to create some crazy ugly
mess?



I have no doubt about it, but that doesn't mean that the feature 

itself is the problem. The problem is the programmer's inexperience,

and it is not the place of the language to teach the programmer

better programming practices.



Goto is great, for example, for cleanups. You put some cleanup 

code in the end of a function and in its body you check for 

several test cases where things could go wrong. If something goes

wrong, you signal the error and jump directly to the cleanup 

with 'goto', instead of having to create a big mess of if's to 

test if an error has happened or not on each step, to then decide

whether your function should continue executing or not. 

It is a primitive in pretty much any architecture 

(cmp, jmp/jz, etc) and used extensively in the linux kernel,

for example.



Anyone who complains about goto being 'dangerous' is either 

a blind fad follower or just believes that the language should

master the programmer (and not the other way around).

------------------------------------------------------------------------
[2010-07-14 01:02:40] risto78 at gmail dot com

sounds like a valid bug to me ;)

------------------------------------------------------------------------
[2010-05-07 14:41:11] anil at ozselgin dot com

It makes php more buggy and suitable only for small programs. Is there
anybody out there like readable code.

------------------------------------------------------------------------
[2009-08-04 18:47:50] and...@php.net

goto hell;

------------------------------------------------------------------------
[2009-06-23 23:56:29] der...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=48669


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=48669&edit=1

Reply via email to