atom feed88 messages in net.php.lists.internalsRe: [PHP-DEV] Proposal: Array syntax
FromSent OnAttachments
3 earlier messages
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:48 am 
Christian SchneiderNov 5, 2003 2:07 am 
s0niXNov 5, 2003 2:43 am 
Ford, Mike [LSS]Nov 5, 2003 3:21 am 
Mike RobinsonNov 5, 2003 3:27 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:08 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:04 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:48 am 
Andi GutmansNov 5, 2003 8:48 am 
Jani TaskinenNov 5, 2003 8:50 am 
Ford, Mike [LSS]Nov 5, 2003 8:51 am 
Marco TabiniNov 5, 2003 8:52 am 
Christian SchneiderNov 5, 2003 8:55 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:01 am 
Marco TabiniNov 5, 2003 9:01 am 
Marco TabiniNov 5, 2003 9:05 am 
Ford, Mike [LSS]Nov 5, 2003 9:08 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:51 am 
35 later messages
Subject:Re: [PHP-DEV] Proposal: Array syntax
From:Andi Gutmans (an@zend.com)
Date:Nov 5, 2003 8:48:13 am
List:net.php.lists.internals

At 11:48 AM 11/5/2003 -0500, Ilia Alshanetsky wrote:

On November 5, 2003 11:21 am, you wrote:

Well, like I said before, I am not sure this is a clear case of that. I'm probably the biggest defender around of the no-magic rule, but [] does imply something array-related to most people, so I think the magic part is much smaller than in other proposals we have seen.

Right now [] could either be an array element or an offset. Now it can either be an array element or a string offset or an attempt to create a new array. Individually it may be fine, but I am certain we'll end up with bug reports of people trying to do $a = $b[1,2,3]; (copied from your resonse ;) ) and similar. Of course someone would then want to do $a[1,2,3] = [3,4,5]; and we're happily on our road to obfuscation.

I mean c'mon, is 5 characters that much of a problem and is absolute code clarity not worth those 5 characters? Character efficiency is done in Perl, where you can do things like ~= and @_, but that makes Perl code naturally obfuscated and I do not think that's a good way to go.

I don't believe in saving characters. You probably know that I tend to prefer looooooong meaningful names and not have all sorts of magic. I think in this case, it's not a matter of saving the typing as it looks much better and IMO is more intuitive. Anyway, it's no biggy and if most people here think it shouldn't be added then that's fine with me.

Andi