atom feed88 messages in net.php.lists.internalsRe: [PHP-DEV] Proposal: Array syntax
FromSent OnAttachments
Christian SchneiderNov 4, 2003 3:32 pm.patch
Rasmus LerdorfNov 4, 2003 5:06 pm 
Ken TossellNov 4, 2003 5:09 pm 
Andi GutmansNov 5, 2003 12:49 am 
Michael WalterNov 5, 2003 12:59 am 
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 
43 later messages
Subject:Re: [PHP-DEV] Proposal: Array syntax
From:Christian Schneider (csch@cschneid.com)
Date:Nov 5, 2003 7:34:30 am
List:net.php.lists.internals

Ok, I tried to just listen to what people are saying but this comment went too far ;-)

Antony Dovgal wrote:

No, it looks like someone trying to turn PHP into Perl (or Python).

I'm just trying to improve PHP. And I write _a lot_ of PHP code, so I have some idea about where the syntax could be improved IMHO.

Personally I would prefer not to import Perl-style & Python-style syntax to PHP.

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.

These things already work well(yes, you can think, that array() & range() are ugly, but they are already used in tonns of projects) and I can't see

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. Saying that array() works well and [] is incomprehensible just does not match my experience. Both for myself (some years of programming experience) and for newbies. I saw no difference teaching people to initialize an array with array() or []. Someone new to programming has to memorize that he has to write $a = array() (and not $a = new array() for example) anyway, $a = [] would be just as easy IMHO.

any reasons to change such fundamental things just because version number changes from 4 to 5.

So why was the whole private/public/static/throw/catch thing introduced? Following your logic people who want this should use Java. I'm much more worried about code getting unreadable because of these extensions actually. It turned PHP into a much more complex language but since it is all optional I don't mind. But to deny some simple (and backward compatible) syntactic sugar to people who just want an easy to use language seems missing the point to me.

If you really like this syntax - use Perl or Python, or whatever you want, but I really can't understand why PHP should allow you to use this

syntax too.

I like some of the Python syntax. But some of it is cumbersome. Same with PHP. But I think PHP is closer to what I want so what's wrong with trying to improve it where it's possible (and easily done)? I used Perl 4 back in the early days but I was horrified by some stuff they added with Perl 5. Perl 6 is actually making some things better again (but no, I'm not going to use it when it comes out in 2010).

[ 'my_cents' => .02 ], - Chris