Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27923 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20985 invoked by uid 1010); 8 Feb 2007 22:58:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20970 invoked from network); 8 Feb 2007 22:58:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2007 22:58:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=hartmut@mysql.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=hartmut@mysql.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mysql.com from 213.136.52.68 cause and error) X-PHP-List-Original-Sender: hartmut@mysql.com X-Host-Fingerprint: 213.136.52.68 mailgate-out2.mysql.com Linux 2.5 (sometimes 2.4) (4) Received: from [213.136.52.68] ([213.136.52.68:37262] helo=mailgate.mysql.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/94-00136-72BABC54 for ; Thu, 08 Feb 2007 17:58:48 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgate.mysql.com (8.13.4/8.13.4) with ESMTP id l18Mwhxw013821; Thu, 8 Feb 2007 23:58:43 +0100 Received: from mail.mysql.com ([10.222.1.99]) by localhost (mailgate.mysql.com [10.222.1.98]) (amavisd-new, port 10026) with LMTP id 10961-06; Thu, 8 Feb 2007 23:58:43 +0100 (CET) Received: from [10.100.64.53] (10-100-64-53.mysql.internal [10.100.64.53]) (authenticated bits=0) by mail.mysql.com (8.13.3/8.13.3) with ESMTP id l18MwZlu019389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Feb 2007 23:58:37 +0100 Message-ID: <45CBAB0B.6010108@mysql.com> Date: Thu, 08 Feb 2007 23:58:19 +0100 Organization: MySQL AB User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20061211 SeaMonkey/1.0.7 MIME-Version: 1.0 To: Mathias Bank CC: internals@lists.php.net References: <011701c7482d$a39f6910$6500a8c0@zend.2k> <45.24.00136.038ABC54@pb1.pair.com> In-Reply-To: <45.24.00136.038ABC54@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailgate.mysql.com Subject: Re: [PHP-DEV] Re: Syntactic improvement to array From: hartmut@mysql.com (Hartmut Holzgraefe) Mathias Bank wrote: > It don't think so: PHP is a good language, but writing code in PHP is > sometimes awful. This could be improved by an alternative syntax. This > could help new developers who are coming from another language. This > could make coding funnier for some developers. Alternative syntax is what makes reading someone else's Perl code "funny" ... ;( > So: what's the matter? The idea of [] does not harm existent code. > Everyone who does not like this syntax can avoid it in his code. > But please don't tell others how they have to write their code! > Let them write! This violates a simple but important principle: The burden shall be on the writer, not the readers. As long as you write code all by yourself and never share it in any way your argument may hold true. The very second your code needs to be read or even maintained by others alternative syntax choices quickly become a nightmare. So you have to agree on one form or the other and add yet another item to your coding style rules list. So you even have to bother *more* about telling others (or yourself) how to write code than you had to with only one syntax alternative. As a matter of taste i do prefer the [] alternative over the current array()/list() approach. But we can't get rid of array() or list() any time soon, even if we would decide to deprecate them now in favor of []. So we're stuck with them and the nicer syntax does not justify the can of worms opened by introducing an alternative syntax for an already existing feature. So if we were designing PHP today i'd be all for [] and [] only, but as things are my vote is mostly against it even though i sort of like the syntax. So from my side a -0.8 -- Hartmut Holzgraefe, Senior Support Engineer . MySQL AB, www.mysql.com