On Wed, 2003-11-05 at 17:48, Andi Gutmans wrote:
> 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.

I don't see a reason for introducing [] for arrays.  And this is coming
from the guy who came up with the original ({ }) syntax in
3.0-pre-alpha, which was replaced with array() for readability.

Let's sum up the pros and cons:

Pros: sexiness?

Cons: another BC issue, syntax obfuscation, potential grammar conflicts

I used to not like array() because it was too verbose, but today I think
it's great because its meaning is very crisp and clear when you read the
code.  Screwing up readable syntax in favor of sexiness is Perl's
business, not PHP's.

 - Stig

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to