| From | Sent On | Attachments |
|---|---|---|
| 40 earlier messages | ||
| Zeev Suraski | Feb 4, 2007 2:02 pm | |
| Pierre | Feb 4, 2007 2:10 pm | |
| Robert Cummings | Feb 4, 2007 3:11 pm | |
| Sara Golemon | Feb 4, 2007 3:25 pm | |
| Richard Lynch | Feb 4, 2007 8:20 pm | |
| Richard Lynch | Feb 4, 2007 8:22 pm | |
| Richard Lynch | Feb 4, 2007 8:26 pm | |
| Richard Lynch | Feb 4, 2007 8:48 pm | |
| Richard Lynch | Feb 4, 2007 8:52 pm | |
| Richard Lynch | Feb 4, 2007 8:54 pm | |
| Gregory Beaver | Feb 4, 2007 9:13 pm | |
| Brian Moon | Feb 4, 2007 11:29 pm | |
| Antony Dovgal | Feb 4, 2007 11:47 pm | |
| Christian Schneider | Feb 5, 2007 2:20 am | |
| Lukas Kahwe Smith | Feb 5, 2007 2:28 am | |
| Christian Schneider | Feb 5, 2007 2:44 am | |
| LAUPRETRE François (P) | Feb 5, 2007 2:53 am | |
| ivai...@gmail.com | Feb 5, 2007 3:00 am | |
| Ford, Mike | Feb 5, 2007 3:18 am | |
| Ford, Mike | Feb 5, 2007 3:29 am | |
| Richard Quadling | Feb 5, 2007 4:16 am | |
| Ford, Mike | Feb 5, 2007 4:35 am | |
| Christian Schneider | Feb 5, 2007 4:54 am | |
| LAUPRETRE François (P) | Feb 5, 2007 5:37 am | |
| Brian Moon | Feb 5, 2007 9:29 am | |
| Stanislav Malyshev | Feb 5, 2007 10:01 am | |
| Andrei Zmievski | Feb 5, 2007 10:02 am | |
| Stanislav Malyshev | Feb 5, 2007 10:04 am | |
| Andrei Zmievski | Feb 5, 2007 10:06 am | |
| Brian Moon | Feb 5, 2007 10:16 am | |
| Stanislav Malyshev | Feb 5, 2007 10:24 am | |
| Todd Ruth | Feb 5, 2007 10:28 am | |
| Brian Moon | Feb 5, 2007 11:07 am | |
| Andrei Zmievski | Feb 5, 2007 11:17 am | |
| Andrei Zmievski | Feb 5, 2007 11:18 am | |
| Brian Moon | Feb 5, 2007 11:32 am | |
| Robert Cummings | Feb 5, 2007 12:28 pm | |
| Stanislav Malyshev | Feb 5, 2007 12:30 pm | |
| Richard Lynch | Feb 5, 2007 3:30 pm | |
| Richard Lynch | Feb 5, 2007 3:33 pm | |
| Stanislav Malyshev | Feb 5, 2007 3:34 pm | |
| Richard Lynch | Feb 5, 2007 3:36 pm | |
| Richard Lynch | Feb 5, 2007 3:40 pm | |
| Richard Lynch | Feb 5, 2007 3:45 pm | |
| Richard Lynch | Feb 5, 2007 3:54 pm | |
| Mike Robinson | Feb 5, 2007 4:10 pm | |
| Robert Cummings | Feb 5, 2007 4:13 pm | |
| Sara Golemon | Feb 5, 2007 4:20 pm | |
| Edin Kadribasic | Feb 5, 2007 4:21 pm | |
| Ford, Mike | Feb 6, 2007 6:07 am | |
| LAUPRETRE François (P) | Feb 6, 2007 6:16 am | |
| Robert Cummings | Feb 6, 2007 6:41 am | |
| Alain Williams | Feb 6, 2007 6:46 am | |
| Christian Schneider | Feb 6, 2007 7:16 am | |
| Alain Williams | Feb 6, 2007 7:19 am | |
| Tullio Andreatta ML | Feb 6, 2007 7:29 am | |
| Ford, Mike | Feb 6, 2007 7:41 am | |
| Lars Schultz | Feb 6, 2007 7:47 am | |
| Robert Cummings | Feb 6, 2007 8:09 am | |
| Andrei Zmievski | Feb 6, 2007 9:26 am | |
| Andrei Zmievski | Feb 6, 2007 9:27 am | |
| Andrei Zmievski | Feb 6, 2007 9:27 am | |
| Richard Lynch | Feb 6, 2007 6:33 pm | |
| Richard Lynch | Feb 6, 2007 6:37 pm | |
| Richard Lynch | Feb 6, 2007 6:40 pm | |
| Ford, Mike | Feb 7, 2007 2:20 am | |
| Ford, Mike | Feb 7, 2007 2:31 am | |
| Mathias Bank | Feb 8, 2007 2:45 pm | |
| Hartmut Holzgraefe | Feb 8, 2007 2:57 pm | |
| Brian Moon | Feb 8, 2007 3:03 pm | |
| Vlad Bosinceanu | Feb 8, 2007 3:25 pm | |
| Subject: | RE: [PHP-DEV] [SPAM] Re: [PHP-DEV] Syntactic improvement to array | |
|---|---|---|
| From: | Ford, Mike (M.F...@leedsmet.ac.uk) | |
| Date: | Feb 6, 2007 6:07:50 am | |
| List: | net.php.lists.internals | |
On 05 February 2007 17:29, Brian Moon wrote:
Ford, Mike wrote:
I don't find:
$a = [1 => ['pears', 'apples'], 2 => ['juice', 'oranges']];
any less readable than:
$a = array(1 => array('pears', 'apples'), 2 => array('juice', 'oranges'));
Quite the opposite actually :)
Me too - I go beyond Edin on this one, as I find the
array() version actually quite UNreadable and I have difficulty picking out what the individual arrays are; conversely, the [] version I take in at a glance.
That is why you have coding standards. Our doucment states that this should be written as:
$a = array( 1 => array('pears', 'apples'), 2 => array('juice', 'oranges') );
I believe in either syntax, proper formatting of complex data can solve the readablity problems.
Solve, no. Alleviate, yes.
Given the above, the layout tells me there's some kind of structure going on, but I still have to actually *read* it to discover that there are arrays involved (and where they start and end).
With this version:
$a = [ 1 => ['pears', 'apples'], 2 => ['juice', 'oranges'] ];
I can take one glance and tell there are nested arrays involved, and what their scopes are -- I'd say my comprehension speed is at least an order of magnitude faster!
*That* makes this syntax a no-brainer for me, personally ;-)
Cheers!
Mike
--------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm





