Re: Re: Syntactic improvement to array

From: Date: Thu, 08 Feb 2007 23:26:20 +0000
Subject: Re: Re: Syntactic improvement to array
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-27927@lists.php.net to get a copy of this message
I for one cringe when I see list(), and I'd love to see [$a, $b] = array(...) become an alternative to that. Can't say I care that much about an alternative syntax for dealing with array creation, but I wouldn't mind. "[]" already suggests "array", and I guess existing developers will have no problem picking it up. Newbies would bump into the docs just as they currently bump into the array section. I don't see how an addition like this could affect people's paychecks. V Brian Moon wrote:
But I have to ask: what's the matter. A good programming language should not force the developer to program as the language wants. A good programming language should support the developer in writing code he likes, the way he likes.
So, you are new to php internal huh? =) Seriously, the language can not be adapted to every whim of every developer. Adding several ways to do things was fine when PHP was a neat tool to mess around with. Now people's paychecks depend on it. IMO, it's a slippery slope to just add things because you can.
This could be improved by an alternative syntax.
Ah, but not all see it as an improvement. Peronsally, every time I see this type of syntax in perl or javascript, I cringe. Luckily I don't do much perl. When I see it in JS, I change it. The funny thing is that Andi probably could have just commited this to the PHP6 tree and made an announcement. There would have been ~4 replies and it would have been over with.


« previous php.internals (#27927) next »