Re: Re: Labeled Breaks (not the G-word)

From: Date: Sun, 27 Nov 2005 19:52:52 +0000
Subject: Re: Re: Labeled Breaks (not the G-word)
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-20666@lists.php.net to get a copy of this message
At 20:03 27/11/2005, Robert Cummings wrote:
On Sun, 2005-11-27 at 07:54, Zeev Suraski wrote: Guys, Laughter has nothing to do with it. However, as discussed between those who attended the meeting in Paris, goto earned its bad connotations for a reason. Goto got it's bad name from when it was used to jump to line numbers. I can't think of a case where jumping to a label within current cope is in any way unclear. It was agreed that providing a general-purpose C-goto equivalent is not a good idea because it *will* very quickly lead to spaghetti coding styles. We also came to the conclusion that the main use case that is not covered by PHP today is that of 'centralized' error recovery, which requires forward jumping only (if it wasn't for that use case, I think we would have had consensus not to add any type of goto at all). So, the logical conclusion appeared to be: 1. A forward-jumping construct only, to avoid giving users too much ammo to shoot themselves in the foot with spaghetti coding. I think it should be called "leap" given your arguments. Because I think your having a "leap of faith" that you will EVER prevent bad developers from shooting themselves in the foot.
Read one of my past posts that deal with how compatibility-breakage is not binary but accumulating. The same applies to abuseable features. The easier we make it to abuse the language, the worse it would be.
IMHO you're marginalizing a useful operator to satisfy your perception of the reputation of goto. I don't think that reputation is well deserved, and I've never heard of spaghetti goto code in C... which as we know does allow backward and forward jumping within scope (not to be confused with none actually existing --- see previous comment about prevention of foot shooting).
You've never heard of spaghetti goto code in C? I'm not sure if it's a joke or not (too tired to understand it if it is) - but I certainly have, and in the more distant past have seen quite a bit of it too. Zeev

« previous php.internals (#20666) next »