Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37972 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89869 invoked from network); 28 May 2008 17:11:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2008 17:11:14 -0000 Authentication-Results: pb1.pair.com header.from=ipso@snappymail.ca; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ipso@snappymail.ca; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain snappymail.ca designates 216.139.220.195 as permitted sender) X-PHP-List-Original-Sender: ipso@snappymail.ca X-Host-Fingerprint: 216.139.220.195 216-139-220-195.aus.us.siteprotect.com Linux 2.6 Received: from [216.139.220.195] ([216.139.220.195:33141] helo=mail.timetrex.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/32-10063-0329D384 for ; Wed, 28 May 2008 13:11:13 -0400 Received: from [192.168.1.9] (S0106005004c32d38.ok.shawcable.net [24.71.236.35]) by mail.timetrex.com (Postfix) with ESMTP id 973284C001; Wed, 28 May 2008 10:11:08 -0700 (PDT) To: Chris Stockton Cc: Mailing List In-Reply-To: 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> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-l5Tx3XVCv/Yp4obubg17" Date: Wed, 28 May 2008 10:11:05 -0700 Message-ID: <1211994665.7621.39.camel@ipso.snappymail.ca> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1-2mdv2009.0 Subject: Re: [PHP-DEV] Re: Short syntax for array literals [...] From: ipso@snappymail.ca (Mike) --=-l5Tx3XVCv/Yp4obubg17 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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.=20 Using Array() is SELF EXPLANATORY! Anyone can see that, search Google for "Array" and learn something about it.=20 How many man hours are going to be wasted: 1. Searching for what the heck [] actually is. 2. Explaining to people that [] is the same as Array. 3. Changing coding standards for projects to prevent [] from being used.=20 4. Enforcing coding standards for projects to prevent [] from being used. 5. Trying to change [] back to Array in hopes of getting code to work on older versions of PHP. 6. All the man hours wasted on it ALREADY that I'm sure could be much better spent getting PHP 5.3/6.0 out. There are enough roadblocks and other things to worry about already, why would we want to add MORE? Especially for something with so little to gain (if anything at all). This isn't about "well if you don't like it, don't use it" either, because no matter what it will be forced on people who don't like it eventually. People who like it will be constantly changing Array() -> [] and people who hate it will be constantly changing [] -> Array(). More wasted time. Just my two cents. On Wed, 2008-05-28 at 08:56 -0700, Chris Stockton wrote: > +1 for: ['foo' =3D> 'bar'], Not sure if it was decided but -1 for ['foo': > 'bar'] >=20 > Here is why, >=20 > Array(), is much more confusing to someone coming with no experience in p= hp > then []. Array() in most languages looks like a function call. So > Array('foo' =3D> 'bar'), verse ['foo' =3D> 'bar'], most people will more = easily > understand the latter when entering into the language fresh. >=20 > I.E.: > $f =3D Array('foo' =3D> 'bar'); > $f('foo'); // comes to mind first right, might not for a php developer bu= t > for a new comer maybe? >=20 > $f =3D ['foo' =3D> 'bar']; > $f['foo']; // great >=20 > Gives our users options, and does not break any existing code or enforce = new > programming paradigm. The change is minor and no real cost in performance= . >=20 > As for existing users, I find the completely negative comments a real > hindrance on the evolution of php as a language. If something does not > damage the language but will offer benefits for a broad user base, as wel= l > as existing code, then let it be. I for one will change every line of cod= e I > have that uses the Array() syntax for the shorter, more WIDELY readable [= ] > syntax. >=20 > My only curiosity is if this will turn into a ecmascript morphism and we > wind up with a new object proposal instead of stdclass, like >=20 > $oStd =3D {'foo' =3D> 'bar'}; > echo $oStd->foo; >=20 > ... doesn't even look all that bad but feels wrong and dirty, I think I > would rather (object) ['foo' =3D> 'bar']; :p >=20 > -Chris --=20 Mike --=-l5Tx3XVCv/Yp4obubg17 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkg9kiQACgkQMhKjsejwBhjjPACbBQwLPa/GHc/+alTA9ZvADqk3 pnAAn179xyUCUFAkjsEieb1LqZzn40A/ =gj9A -----END PGP SIGNATURE----- --=-l5Tx3XVCv/Yp4obubg17--