atom feed88 messages in net.php.lists.internalsRE: [PHP-DEV] Proposal: Array syntax
FromSent OnAttachments
5 earlier messages
Michael WalterNov 5, 2003 1:03 am 
Kouber SaparevNov 5, 2003 1:47 am 
Christian SchneiderNov 5, 2003 2:06 am 
s0niXNov 5, 2003 2:43 am 
Ford, Mike [LSS]Nov 5, 2003 3:20 am 
Mike RobinsonNov 5, 2003 3:26 am 
Dirkjan OchtmanNov 5, 2003 3:45 am 
Cesare D'AmicoNov 5, 2003 4:02 am 
Alexey TrunyovNov 5, 2003 4:34 am 
Antony DovgalNov 5, 2003 4:59 am 
Marco TabiniNov 5, 2003 5:04 am 
Ilia AlshanetskyNov 5, 2003 5:06 am 
Magnus MäättäNov 5, 2003 5:07 am 
Derick RethansNov 5, 2003 5:18 am 
Christian SchneiderNov 5, 2003 7:34 am 
Nicolas ToperNov 5, 2003 7:47 am 
Ilia AlshanetskyNov 5, 2003 7:56 am 
Antony DovgalNov 5, 2003 8:03 am 
Rasmus LerdorfNov 5, 2003 8:21 am 
Christian SchneiderNov 5, 2003 8:30 am 
Andrey HristovNov 5, 2003 8:40 am 
Ilia AlshanetskyNov 5, 2003 8:47 am 
Andi GutmansNov 5, 2003 8:47 am 
Jani TaskinenNov 5, 2003 8:49 am 
Ford, Mike [LSS]Nov 5, 2003 8:50 am 
Marco TabiniNov 5, 2003 8:52 am 
Christian SchneiderNov 5, 2003 8:54 am 
George SchlossnagleNov 5, 2003 8:58 am 
Jani TaskinenNov 5, 2003 8:59 am 
Christian SchneiderNov 5, 2003 9:00 am 
Ford, Mike [LSS]Nov 5, 2003 9:00 am 
Marco TabiniNov 5, 2003 9:01 am 
Marco TabiniNov 5, 2003 9:05 am 
Ford, Mike [LSS]Nov 5, 2003 9:07 am 
Ford, Mike [LSS]Nov 5, 2003 9:09 am 
Marco TabiniNov 5, 2003 9:18 am 
Romans MalinovskisNov 5, 2003 9:19 am 
Andi GutmansNov 5, 2003 9:20 am 
StephNov 5, 2003 9:25 am 
Andrey HristovNov 5, 2003 9:25 am 
Ilia AlshanetskyNov 5, 2003 9:25 am 
Marco TabiniNov 5, 2003 9:30 am 
Derick RethansNov 5, 2003 9:33 am 
George SchlossnagleNov 5, 2003 9:36 am 
Rasmus LerdorfNov 5, 2003 9:45 am 
Edin KadribasicNov 5, 2003 9:45 am 
Romans MalinovskisNov 5, 2003 9:48 am 
Moriyoshi KoizumiNov 5, 2003 9:50 am 
Jani TaskinenNov 5, 2003 9:54 am 
Jaap van GanswijkNov 5, 2003 10:06 am 
33 later messages
Subject:RE: [PHP-DEV] Proposal: Array syntax
From:Ford, Mike [LSS] (M.F@lmu.ac.uk)
Date:Nov 5, 2003 8:50:44 am
List:net.php.lists.internals

On 05 November 2003 15:57, Ilia Alshanetsky contributed these pearls of wisdom:

On November 5, 2003 10:34 am, Christian Schneider wrote:

PHP is a mix of C, Perl and other styles anyway, why deny it? It's strength is that it's a pragmatic and simple language but that doesn't mean that nothing should be changed ever.

PHP strength (IMHO) is it's simple and clear syntax, which allows people who come from background in other programming languages can quickly recognize and get used to. Creating confusing alternate syntaxes will bring us ever closer to Perl 6 where there are dozens of way to do the same thing. The end results in a confusing and hard to read/write language that all but the most dedicated of users refuse to use.

Yes, I agree with this, but I also think that a modicum of alternatives in a few strategically chosen places also makes a language easier to use for people coming from different backgrounds and with different style prejudices -- or even just with differently-built brains! A prime example of this is the "alternative structure syntax" -- as a confirmed and long-time hater of the curly-brackets-for-everything style (as a result of many years of using it in B, c, JavaScript and others), I was overjoyed to discover the alternative :-syntax in PHP and use it exclusively in all my scripts. Contrariwise, there are some features in (and not in!) PHP that I think are pretty silly, but some of its prime maintainers defend to the death -- well, that's their opinion and I would defend to the death their right to have it, whilst nevertheless continuing to disagree with them.

I don't want to break existing programs. And I don't care about range() (or even list() too much for that matter), I just recognize the fact the I'm using a lot of array() and it is both unnecessarily hard to write _and_ read.

That's bull, 5 characters is hard to write? If anything those 5 characters make it absolutely clear to ANYONE that the data is an array and not an object or a string or some other type. When I first saw the syntax is took me a few seconds to realize what it does and the problem would only be compounded when the code is found within an pre-existing complex script.

Well, my view on that is the exact contrary -- I find the 5 letters in question and their associated parentheses easy to lose in the surrounding and very similar code, whereas the [] syntax both stands out much better against surrounding noise and is, for me, more intuitive. I think there's room for both -- I and all the other +1s would no doubt enthusiastically switch over wholesale to [], whilst you and the other -1s would stick with array(). I would have no problem with that, and to me it would be an advantage of the language that it supports such choice.

Cheers!

Mike