Andi 2003:
internals@lists.php.net/msg03896.html" rel="nofollow" target="_blank">http://www.mail-archive.com/internals@lists.php.net/msg03896.html
Andi's brain evolves 2007:
http://marc.info/?l=php-internals&m=117057393530217&w=2
And today I'm still +1.
I really think by looking at some of the examples I worked through with
my original posting in February and some of the recent comments the
majority of people find [] more readable. It's cleaner, shorter and
comes natural to most people. It's not about saving 5 characters as I
type quickly, I really feel it's more readable and natural. We're kind
of odd as a language in that sense i.e. array(...)
I think almost everyone here agreed it'd benefit them and maybe the ones
who don't would go through the same process I went through once they get
used to it J
Andi
And my stance hasn't changed either:
http://marc.info/?l=php-internals&m=117060700805108&w=2
Andi Gutmans wrote:
Andi 2003:
internals@lists.php.net/msg03896.html" rel="nofollow" target="_blank">http://www.mail-archive.com/internals@lists.php.net/msg03896.htmlAndi's brain evolves 2007:
http://marc.info/?l=php-internals&m=117057393530217&w=2And today I'm still +1.
I really think by looking at some of the examples I worked through with
my original posting in February and some of the recent comments the
majority of people find [] more readable. It's cleaner, shorter and
comes natural to most people. It's not about saving 5 characters as I
type quickly, I really feel it's more readable and natural. We're kind
of odd as a language in that sense i.e. array(...)I think almost everyone here agreed it'd benefit them and maybe the ones
who don't would go through the same process I went through once they get
used to it JAndi
Hello all,
The array() syntax to me screams function call, something that, in my
mind, did not intuitively mean assign an array to a plain ole
variable.
If I can:
$var1 = 5;
why would I need a special function call "array()" to create and
assign an array?
An array is just like any other variable right?
// Seems more natural to me.
$array1 = ['a' => 1, 'b' => 2];
// than a function call...
$array2 = array("a" => 1, "b" => 2);
That was one of the little things that I remember being wierd about
PHP when I first started coding in it.
Cheers,
Antonio
And my stance hasn't changed either:
http://marc.info/?l=php-internals&m=117060700805108&w=2
Andi Gutmans wrote:
Andi 2003:
internals@lists.php.net/msg03896.html" rel="nofollow" target="_blank">http://www.mail-archive.com/internals@lists.php.net/msg03896.htmlAndi's brain evolves 2007:
http://marc.info/?l=php-internals&m=117057393530217&w=2And today I'm still +1.
I really think by looking at some of the examples I worked through with
my original posting in February and some of the recent comments the
majority of people find [] more readable. It's cleaner, shorter and
comes natural to most people. It's not about saving 5 characters as I
type quickly, I really feel it's more readable and natural. We're kind
of odd as a language in that sense i.e. array(...)I think almost everyone here agreed it'd benefit them and maybe the ones
who don't would go through the same process I went through once they get
used to it JAndi
--
--
Antonio Touriño
Brilliance Tech - Consultoría sobre Estrategia Web
Cel: +507.66716999
Hello mr. Antonio Touriño,
So as if I understand, you want to change the syntax of array() keyword.
Will you mind to update the changes in all php scripts in the world too?
PS. You can always have your [] in custom patch, but I do not think
it's useful to want it globally changed.
It is not about changing, it is about adding a different way to declare
arrays (the function-style way will remain). The current code base will be
unaffected.
+1 vote from me to add ['x'=>'y']
Hello mr. Antonio Touriño,
So as if I understand, you want to change the syntax of array() keyword.
Will you mind to update the changes in all php scripts in the world too?PS. You can always have your [] in custom patch, but I do not think
it's useful to want it globally changed.
Hello mr. Antonio Touriño,
So as if I understand, you want to change the syntax of array() keyword.
Will you mind to update the changes in all php scripts in the world too?PS. You can always have your [] in custom patch, but I do not think
it's useful to want it globally changed.
Well this is not a change, but an alternative syntax. The patch simply
adds this new syntax, you can still use array().
+1 (option b)
--
Tullio Andreatta
09:f9:11:02:9d:74:e3:5b:d8:41:56:c5:63:56:88:c0
45:5f:e1:04:22:ca:29:c4:93:3f:95:05:2b:79:2a:b2
Disclaimer: "Please treat this email message in a reasonable way, or we
might get angry" ( http://www.goldmark.org/jeff/stupid-disclaimers )
The array() syntax to me screams function call, something that,
You mean just like if(), for(), while(), foreach(), elseif() and... ?
regards,
Derick
--
Derick Rethans
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org
Rasmus Lerdorf wrote:
And my stance hasn't changed either:
+1
I think almost everyone here agreed it'd benefit them and maybe the ones
who don't would go through the same process I went through once they get
used to it J
I don't know about that, I for once find it silly to even try to argue
that [] is a good idea, but at the same time are fully against scalar
typehints.
It is argued that [] is good for readability, although looking up [ or ]
anywhere will not produce results. Hence, it is more cryptic to use,
harder to find information on - and it doesn't provide any new
functionality. array() has been working fine for more than 10 years.
On the other hand, it is argued that scalar typehints are confusing for
new users. I don't see how because it is much easier to provide
search-index information for on our website, and they actually provide
new functionality as they make it users for users of libraries to see
instantly whether they use that library correctly.
regards,
Derick
Derick Rethans
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org
I use PHP since version 5.0 release
I'd like use this syntax
$a = [ 2,6,9 ];
$b = ['a'=>1 , 'v'=>'string'];
foo(['bar'=>2, 'test'=null]);
Andi Gutmans пишет:
Andi 2003:
internals@lists.php.net/msg03896.html" rel="nofollow" target="_blank">http://www.mail-archive.com/internals@lists.php.net/msg03896.htmlAndi's brain evolves 2007:
http://marc.info/?l=php-internals&m=117057393530217&w=2And today I'm still +1.
I really think by looking at some of the examples I worked through with
my original posting in February and some of the recent comments the
majority of people find [] more readable. It's cleaner, shorter and
comes natural to most people. It's not about saving 5 characters as I
type quickly, I really feel it's more readable and natural. We're kind
of odd as a language in that sense i.e. array(...)I think almost everyone here agreed it'd benefit them and maybe the ones
who don't would go through the same process I went through once they get
used to it JAndi
Hi,
I use PHP since version 5.0 release
I'd like use this syntax
$a = [ 2,6,9 ];
$b = ['a'=>1 , 'v'=>'string'];
foo(['bar'=>2, 'test'=null]);
The last line is exactly why I won't like such a syntax. Just consider
the a bit worse call like
foo([1, $a[2]]);
I might even construct worse examples, but in the end you'll have to
take a quite close look to see what's going on, whereas the array()
syntax directly tells you "hey, here's an array", it are just 5 letters,
so typing it isn't too hard (especially when using an editor with
completion) ...
Yes, it's nice in short code, but I think it makes it way harder to read
other people's code - and that's already hard enough. (I, myself, would,
of course, ( ;-) ) use it "right" but I tend to read more code than I
write)
johannes
Johannes Schlüter writes:
The last line is exactly why I won't like such a syntax. Just consider
the a bit worse call like
foo([1, $a[2]]);
I might even construct worse examples,
is this a good-readable code?
foo (array('a'=2,'b'=>array('x'=>5,'c'=>array(1,4,2)),'n'=>$bar[4]));
what difference in?
foo(['a'=2,'b'=>['x'=>5,'c'=>[1,4,2]],'n'=>$bar[4]]);
I think - it will be good readable in large projects too.
Please look to code of ExtJS JavaScript Library - this syntax native in
javascript and it very usable
(excuse me for my English)
Hi,
Guys, there is really no point to argue about aesthetic or taste. Make
your point by using +1/-1 and that's it. As said, the trolls quota has
been used already.
Thanks for my bandwidth,
Johannes Schlüter writes:
The last line is exactly why I won't like such a syntax. Just consider
the a bit worse call like
foo([1, $a[2]]);
I might even construct worse examples,is this a good-readable code?
foo (array('a'=2,'b'=>array('x'=>5,'c'=>array(1,4,2)),'n'=>$bar[4]));
what difference in?
foo(['a'=2,'b'=>['x'=>5,'c'=>[1,4,2]],'n'=>$bar[4]]);I think - it will be good readable in large projects too.
Please look to code of ExtJS JavaScript Library - this syntax native in
javascript and it very usable(excuse me for my English)
--
--
Pierre
http://blog.thepimp.net | http://www.libgd.org
-1
+1
-1
Tomi Kaistila
PHP Developer
+1 on option b.
-1
PHP is not Python.
--Marcelo
+1 on option b.
--
--
Marcelo Araujo
Founder & Software Architect
Cell Phone: +55 34 9144 1472
JMCodex (http://www.jmcodex.com)
skype: marcelocrosara
-1
--
Mikko Koppanen
One problem, I have with this proposal is, that it isn't much like
javascript anyway. In javascript, there is a distinction between array
and hashmap, with different syntaxes. If anything, the syntax should
probably be {'foo' => 1, 'bar' => 2}.
I don't think the added noise is worth it though, since we already
have a syntax, which has worked for a decade. Having two different
syntaxes, for the exact same thing, isn't that great an idea. All
IMHO, of course.
-1 for those counting.
--
troels
(Which is in fact pronounced trolls)
-1
On Jan 11, 2008, at 12:55 PM, "troels knak-nielsen"
troelskn@gmail.com wrote:
One problem, I have with this proposal is, that it isn't much like
javascript anyway. In javascript, there is a distinction between array
and hashmap, with different syntaxes. If anything, the syntax should
probably be {'foo' => 1, 'bar' => 2}.
I don't think the added noise is worth it though, since we already
have a syntax, which has worked for a decade. Having two different
syntaxes, for the exact same thing, isn't that great an idea. All
IMHO, of course.
-1 for those counting.--
troels
(Which is in fact pronounced trolls)
Hi,
Guys, there is really no point to argue about aesthetic or taste. Make
your point by using +1/-1 and that's it. As said, the trolls quota has
been used already.
+1 FWIW :-)
--
Giedrius
Guys, there is really no point to argue about aesthetic or taste. Make
your point by using +1/-1 and that's it. As said, the trolls quota has
been used already.
+1
-chuck
-1
-Hannes
+1
+1
-1
-1
Ilia Alshanetsky
+1 (for the record in this thread :)
--
Pierre
http://blog.thepimp.net | http://www.libgd.org
+1 (for the record in this thread :)
-1
regards,
Lukas
-1
+1 (for the record in this thread :)
--
Pierre
http://blog.thepimp.net | http://www.libgd.org
--
Patches/Donations: http://pecl.php.net/~jani/
+1
+1
Best regards
Stephan
+1
Mark Dennehy
+1
Ryusuke SEKIYAMA
On Thu, 10 Jan 2008 15:51:51 -0800, in php.internals andi@zend.com
("Andi Gutmans") wrote:
Andi 2003:
internals@lists.php.net/msg03896.html" rel="nofollow" target="_blank">http://www.mail-archive.com/internals@lists.php.net/msg03896.htmlAndi's brain evolves 2007:
http://marc.info/?l=php-internals&m=117057393530217&w=2And today I'm still +1.
I really think by looking at some of the examples I worked through with
my original posting in February and some of the recent comments the
majority of people find [] more readable. It's cleaner, shorter and
comes natural to most people. It's not about saving 5 characters as I
type quickly, I really feel it's more readable and natural. We're kind
of odd as a language in that sense i.e. array(...)I think almost everyone here agreed it'd benefit them and maybe the ones
who don't would go through the same process I went through once they get
used to it JAndi
--
- Peter Brodersen
+1
(sorry for the first post)
- Peter Brodersen
Andi 2003:
internals@lists.php.net/msg03896.html" rel="nofollow" target="_blank">http://www.mail-archive.com/internals@lists.php.net/msg03896.htmlAndi's brain evolves 2007:
http://marc.info/?l=php-internals&m=117057393530217&w=2And today I'm still +1.
I really think by looking at some of the examples I worked through with
my original posting in February and some of the recent comments the
majority of people find [] more readable. It's cleaner, shorter and
comes natural to most people. It's not about saving 5 characters as I
type quickly, I really feel it's more readable and natural. We're kind
of odd as a language in that sense i.e. array(...)I think almost everyone here agreed it'd benefit them and maybe the ones
who don't would go through the same process I went through once they get
used to it J
FWIW, I'm a +1
:)
Andi
/////////////////////////////////////////////////////
Service provided by hitOmeter.NET internet messaging!
.
-1
Readability degrades quite a lot.
-1
Readability degrades quite a lot.
+1 (b)
Readability will only degrade as much as the coder allows it to.
Besides, I don't get the impression that array() is going to
disappear, only that another option is to be added.
--
</Dan>
Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since
Nineteen-Seventy-[mumble].