Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52743 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73400 invoked from network); 2 Jun 2011 09:49:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jun 2011 09:49:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=M.Ford@leedsmet.ac.uk; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=M.Ford@leedsmet.ac.uk; sender-id=pass Received-SPF: pass (pb1.pair.com: domain leedsmet.ac.uk designates 207.126.144.129 as permitted sender) X-PHP-List-Original-Sender: M.Ford@leedsmet.ac.uk X-Host-Fingerprint: 207.126.144.129 eu1sys200aog110.obsmtp.com Linux 2.5 (sometimes 2.4) (4) Received: from [207.126.144.129] ([207.126.144.129:53440] helo=eu1sys200aog110.obsmtp.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 88/14-49351-8BC57ED4 for ; Thu, 02 Jun 2011 05:49:45 -0400 Received: from mrelay-a.lmu.ac.uk ([160.9.128.16]) by eu1sys200aob110.postini.com ([207.126.147.11]) with SMTP ID DSNKTedctRlfq12ylAEJa7l0JxVcNaKoQtWq@postini.com; Thu, 02 Jun 2011 09:49:44 UTC Received: from exc-hcas01.leedsmet.ac.uk ([160.9.47.11]) by mrelay-a.lmu.ac.uk with esmtp (Exim 4.60) (envelope-from ) id 1QS4X7-0002IX-6z for internals@lists.php.net; Thu, 02 Jun 2011 10:49:41 +0100 Received: from EXC-MBX02.leedsmet.ac.uk ([fe80::a1c1:32b9:3881:d170]) by EXC-HCAS01.leedsmet.ac.uk ([fe80::dd92:4ba5:bb34:c36b%11]) with mapi id 14.01.0270.001; Thu, 2 Jun 2011 10:49:41 +0100 To: PHP internals Thread-Topic: [PHP-DEV] RFC: Short syntax for Arrays (redux) Thread-Index: AQHMH8K0rN48YBnbU0SGglw0KsxzsZSor8SAgAAiPYCAAANHgIAAAVeAgAABe4CAAAUjAIAACcuAgAAMwQCAAApmgIAAvn7A Date: Thu, 2 Jun 2011 09:49:40 +0000 Message-ID: <3158105795AAC1408619EC8BA03384A90A3720@EXC-MBX02.leedsmet.ac.uk> References: <4DE5368A.6050603@moonspot.net> <8BEEEE49-8DA3-4634-BF9C-120F7A15B613@roshambo.org> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.8.18.196] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [PHP-DEV] RFC: Short syntax for Arrays (redux) From: M.Ford@leedsmet.ac.uk ("Ford, Mike") > -----Original Message----- > From: John Crenshaw [mailto:johncrenshaw@priacta.com] > Sent: 01 June 2011 23:00 >=20 > Spot on. It has nothing to do with extra typing (and that sort of > design is part of what ruined Ruby). My fingers move plenty fast and > if extra characters make things more safe or more readable, I'll be > the first to sign up. In this case, however, the extra characters > just make things messy. > 1. The most readable format is pure JSON Matter of opinion. I don't agree. > 2. The most familiar format is pure JSON (because these same > developers are almost certainly already using it in their jQuery > code) Also matter of opinion, and of experience. Apart from the fact that my use of jQuery amounts to a few weeks out of a (mumble)-year programming career, no I don't use pure JSON for it - Javascript object literals, yes, but not pure JSON. > 3. The most compact format is pure JSON Um. Depends. I would tend to write 'a': 'b' in JSON, but 'a'=3D>'b' in PHP. But YMMV. > 4. The format most consistent with other languages is JSON Again, matter of experience. Last time I counted, I'd used upward of 30 different programming languages and dialects, some of which had very bizarre ways of representing things, and none of which (apart from Javascript!) used a JSON-like array-literal syntax. And, actually, I *want* my PHP arrays to look different from my Javascript/JSON arrays, especially as I might be looking at both as part of the same project -- I *want* a big data structure to scream "I'm PHP" or "I'm Javascript/JSON" at me, to help trigger my brain into the right programming mode. All of this is just IMHO, of course, and probably a lot more than my regulation 2 pennorth, but there you go. Cheers! Mike --=20 Mike Ford, Electronic Information Developer, Libraries and Learning Innovation,=20=20 Leeds Metropolitan University, C507 City Campus,=20 Portland Way, LEEDS,=A0 LS1 3HE,=A0 United Kingdom=20 E: m.ford@leedsmet.ac.uk T: +44 113 812 4730 To view the terms under which this email is distributed, please go to http:= //disclaimer.leedsmet.ac.uk/email.htm