Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37981 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23514 invoked from network); 28 May 2008 19:43:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2008 19:43:27 -0000 Authentication-Results: pb1.pair.com header.from=chrisstocktonaz@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=chrisstocktonaz@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.46.28 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: chrisstocktonaz@gmail.com X-Host-Fingerprint: 74.125.46.28 yw-out-2324.google.com Received: from [74.125.46.28] ([74.125.46.28:16290] helo=yw-out-2324.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/E7-10063-ED5BD384 for ; Wed, 28 May 2008 15:43:27 -0400 Received: by yw-out-2324.google.com with SMTP id 5so1735531ywb.83 for ; Wed, 28 May 2008 12:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=o4MW0Q0WbnnLzU13GEpFz2SlJMqxLCNlf7ftf96gysk=; b=ELD4hhj1Wr6Uik9Lu9LLnkynn4ZsgnP8gcZ7JxlGHPsMKKdVX734B/NMivY9/sYiFfTYNvOV82zVZyzgK5cpQ5eKzB4lNcYr2hhoy4ojYLoeKmeqTSCNREE1PKL8s9iigCiuY8yl6RmEVEqp7r2+UeNDQAXQEPG+reg3K0uwH0A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=SttZqFZU/CGzxiyny08CkdbyPHV38kgkt3dn0tcQ3MISx6hqnHL+948xTyxP0IA0/XbQg1P+/1gj5mgZhzeuBZUCbMlt8Sh82aJXO55SDRRv3Ui+wVqhZfZxe7XKmszW+WQGwV0x7SJ9hOkj9Xh225Ebc2yEybhN8cYJO6FzGq8= Received: by 10.142.237.19 with SMTP id k19mr1204022wfh.86.1212003804100; Wed, 28 May 2008 12:43:24 -0700 (PDT) Received: by 10.142.127.4 with HTTP; Wed, 28 May 2008 12:43:23 -0700 (PDT) Message-ID: Date: Wed, 28 May 2008 12:43:23 -0700 To: "Gregory Beaver" Cc: "Stan Vassilev | FM" , "PHP Developers Mailing List" In-Reply-To: <483DAE91.7020505@chiaraquartet.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_18624_30503845.1212003804094" References: <0412F6FE505049F7901EAB8C61774839@pc> <483DAE91.7020505@chiaraquartet.net> Subject: Re: [PHP-DEV] Re: Short syntax for array literals [...] From: chrisstocktonaz@gmail.com ("Chris Stockton") ------=_Part_18624_30503845.1212003804094 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, On Wed, May 28, 2008 at 12:12 PM, Gregory Beaver wrote: > I've thought about allowing [] for a while and personally have come up > with my own litmus test for new features. > > 1) is the syntax missing from the language? > 2) if so, does the syntax add missing functionality or significant > maintenance benefit? > 2) if not, does the new syntax add significant value? > > #1 no, array() is the same [-1] This is not a valid argument, in my opinion. > > #2 not applicable [0] How can you dismiss whether the syntax adds benefit? If a single person finds it beneficial it has a benefit, maybe not a majority benefit, but a benefit none the less. Lots of people will find it easier to pick up coming from other languages. > > #3 [-.5] > * can't google [] If we are going to use google search as a determinative for language decisions we got some major cleanup to do, lets start by removing curly braces.. > > * makes arrays simpler to type and take up less space > * adds potential for confusion between array access and creation: > > $a['hi']; > $a;['hi']; > > both are now suddenly valid PHP As far as $a;[0]; goes, that is just a problem with useless contexts allowed in PHP. Same can be done for $a;Array(0), which I doubt would cause debugging problems (i do get your point). Really their are many places for syntax errors, and php does allow a lot of useless syntax, like: $a;;;$b;;;$c;;;;{{;;;{{}}}};;;;;;;;;;;;;;; ... that is perfectly valid code. At the end of the day the developer needs to have sufficient ability to debug their code. > > > * syncs with javascript and other languages > * opens pandoras box - PHP is simpler than Perl because there are not > 20 ways of doing the same thing with different punctuation shorthands > See my previous post, 20 ways of doing one thing is part of the language already, and what makes programming interesting. > So I find #1 is -1, #2 is 0, #3 is about -.5 > > Although the idea is somewhat attractive, I've found no drawbacks to > array() syntax, and plenty of dangers with adding any new alternate > syntax, and this ultimately makes my vote -1 Just my opinion. -Chris ------=_Part_18624_30503845.1212003804094--