Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37988 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30061 invoked from network); 29 May 2008 04:31:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 May 2008 04:31:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 204.11.219.139 mail.lerdorf.com Received: from [204.11.219.139] ([204.11.219.139:57532] helo=mail.lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DC/D0-24593-4B13E384 for ; Thu, 29 May 2008 00:31:49 -0400 Received: from [192.168.200.148] (c-24-6-219-206.hsd1.ca.comcast.net [24.6.219.206]) (authenticated bits=0) by mail.lerdorf.com (8.14.3/8.14.3/Debian-4) with ESMTP id m4T4Vgob014048; Wed, 28 May 2008 21:31:42 -0700 Message-ID: <483E31AE.6000104@lerdorf.com> Date: Wed, 28 May 2008 21:31:42 -0700 User-Agent: Thunderbird 2.0.0.4 (Macintosh/20070604) MIME-Version: 1.0 To: Mike CC: Chris Stockton , Mailing List References: <0412F6FE505049F7901EAB8C61774839@pc> <87.77.15519.9E47C384@pb1.pair.com> <97.F8.15519.1229C384@pb1.pair.com> <483C94EA.90507@zend.com> <483C95DD.6000006@sci.fi> <698DE66518E7CA45812BD18E807866CE01A53A06@us-ex1.zend.net> <1211994665.7621.39.camel@ipso.snappymail.ca> In-Reply-To: <1211994665.7621.39.camel@ipso.snappymail.ca> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mail.lerdorf.com [204.11.219.139]); Wed, 28 May 2008 21:31:42 -0700 (PDT) Subject: Re: [PHP-DEV] Re: Short syntax for array literals [...] From: rasmus@lerdorf.com (Rasmus Lerdorf) Mike wrote: > In my opinion I don't think PHP would be where it is today if it wasn't > for being so easy to learn and use. > > I attribute this directly to the fact that it didn't use a lot of > "syntax sugar" that is unreadable and can't be "Googled" for. You can't > Google "[]", and my guess is searching PHP.net for "[]" won't return > anything useful either. > > Using Array() is SELF EXPLANATORY! Anyone can see that, search Google > for "Array" and learn something about it. > > How many man hours are going to be wasted: > 1. Searching for what the heck [] actually is. This "No Magic" mantra is something I have been using since day one to guide decisions like this in PHP. But I think you guys are misappropriating it. [] is already our array syntax. $a[1] assumes that the user realize that [] has something to do with arrays. If they don't, they are out of luck, because as you say, you can't search for [] and get something useful. But that's already the case and we are simply building on that existing knowledge. We have to have a minimum set of operators that we feel reasonable certain that people understand. ?: is also not easy to search for, yet we added this ternary shortcut. Likewise, <<< is not easy to look up, but we added HEREDOC and more recently NOWDOC with this syntax. PHP is about building on the knowledge and experience of the typical target user. This target user changes slowly as we all get older and the industry we are in changes and we need to recognize that and adapt the language appropriately. What is appropriate is of course a really hard call which is what this is all about. -Rasmus