On Wed, 5 Nov 2003, Ilia Alshanetsky wrote:
> 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.
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.
> 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.
I do agree that [1,2,3] is not easier to read than array(1,2,3), but I
don't think there is a huge difference between the two. I guess we could
sample a few newbie users to see what they think $a = [1,2,3]; would do.
Of course, then people are going to try to do $a = $b[1,2,3]; and then we
are all messed up.
-Rasmus
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php