Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11622 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20937 invoked by uid 1010); 29 Jul 2004 22:09:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20908 invoked from network); 29 Jul 2004 22:09:10 -0000 Received: from unknown (HELO iko.gotobg.net) (80.168.8.116) by pb1.pair.com with SMTP; 29 Jul 2004 22:09:10 -0000 Received: from pd9e61a6e.dip.t-dialin.net ([217.230.26.110] helo=[192.168.0.32]) by iko.gotobg.net with asmtp (Exim 4.34) id 1BqJ5P-0004fy-9C; Fri, 30 Jul 2004 01:09:15 +0300 Message-ID: <41098F91.3000606@hristov.com> Date: Fri, 30 Jul 2004 00:00:17 +0000 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a2) Gecko/20040627 X-Accept-Language: en-us, en MIME-Version: 1.0 To: ilia@prohost.org CC: internals@lists.php.net References: <20040729021337.73894.qmail@pb1.pair.com> <200407291117.09573.lpedretti@suserver.com> <200407291037.12396.ilia@prohost.org> In-Reply-To: <200407291037.12396.ilia@prohost.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iko.gotobg.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] GOTO operator From: php@hristov.com (Andrey Hristov) Ilia Alshanetsky wrote: > PHP is a not a type strict language, far from it and it is unlikely it'll ever > be such. It is also a not pure OOP language and I very much doubt it'll ever > be one. > While GOTO can be abused, so can any other language feature, such as OOP, or > the ability to include remote files. If we add this feature certain warnings > should made about it using it (as with almost any feature), but I see no > reason to cripple advanced users simply other users may find fun and usual > ways to abuse this useful functionality. Anyone who has ever written a parser > will tell you GOTO is absolutely essential unless you want to go into > recursive functions etc... which are way slower. GOTO also provides a fast an > safe alternative to many solution where so far the only viable option (for > most people) have been a recursive functions and those tend to smash the > stack once in a while. > 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. Looks like I am -1 if that counts :) thanks, andrey