Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11624 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58097 invoked by uid 1010); 29 Jul 2004 22:18:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56972 invoked from network); 29 Jul 2004 22:18:08 -0000 Received: from unknown (HELO asuka.prohost.org) (69.196.31.138) by pb1.pair.com with SMTP; 29 Jul 2004 22:18:08 -0000 Received: (qmail 19841 invoked from network); 29 Jul 2004 22:18:07 -0000 Received: from rei.nerv (HELO dummy.com) (rei@192.168.1.1) by asuka.nerv with SMTP; 29 Jul 2004 22:18:07 -0000 Reply-To: ilia@prohost.org To: Andrey Hristov , internals@lists.php.net Date: Thu, 29 Jul 2004 18:18:13 -0400 User-Agent: KMail/1.6.1 References: <20040729021337.73894.qmail@pb1.pair.com> <200407291037.12396.ilia@prohost.org> <41098F91.3000606@hristov.com> In-Reply-To: <41098F91.3000606@hristov.com> Organization: Prohost.org MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: <200407291818.13704.ilia@prohost.org> Subject: Re: [PHP-DEV] GOTO operator From: ilia@prohost.org (Ilia Alshanetsky) On July 29, 2004 08:00 pm, Andrey Hristov wrote: > Is the average Joe going to write parsers in the everydays work? Probably > not. But give him the power of goto and (s)he is going to shoot him/her in > the legs, in the heart, in the head. And even not only himself because > (s)he will create a legacy code which someone else has to understand and > fix. We have extract() and we say in the docs it is not good to use it to > populate variables but people hack and workaround register_globals set to > off by just using this function. IMO PHP has enough power even without > "goto". Left aside what Dijkstra has written. goto code tends to become > spaghetti one. Sometimes I miss it when write PHP scripts (for example > jumping between 2 clauses in a switch, something which is used in > var_dump() C implementation) but then I reconsider that it is better this > way. Parsers are just one place where GOTOs show their merit. GOTOs can be immensely useful error handling mechanism that can save having to make dozens of functions just to avoid code duplication. As I had mentioned earlier GOTO can be used to eliminate stack smashes caused by recursive functions that are the simplest solution (according to average Joe) to many problems. IMHO just saying something can be abused does not seem like a good reason, because that can applied to anything. Exceptions can be abused, OO can be abused, xml can be abused, etc... Ilia