

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
99 messages in net.php.lists.internalsRe: [PHP-DEV] Re: Short syntax for ar...| From | Sent On | Attachments |
|---|---|---|
| Stan Vassilev | FM | May 21, 2008 7:12 pm | |
| Felipe Pena | May 21, 2008 7:20 pm | |
| Stanislav Malyshev | May 21, 2008 8:53 pm | |
| Pierre Joye | May 22, 2008 2:46 am | |
| Antony Dovgal | May 22, 2008 2:56 am | |
| Pierre Joye | May 22, 2008 3:33 am | |
| Johannes Schlüter | May 22, 2008 6:56 am | |
| Pierre Joye | May 22, 2008 7:28 am | |
| Philip Olson | May 22, 2008 8:55 am | |
| Stanislav Malyshev | May 22, 2008 9:17 am | |
| Andi Gutmans | May 22, 2008 9:15 pm | |
| Brian Moon | May 22, 2008 9:29 pm | |
| Lokrain | May 23, 2008 1:28 am | |
| Pierre Joye | May 23, 2008 1:58 am | |
| Alexey Zakhlestin | May 23, 2008 2:06 am | |
| Jani Taskinen | May 23, 2008 4:45 am | |
| Eric Coleman | May 23, 2008 6:43 am | |
| Yi Wang | May 23, 2008 8:17 am | |
| Sebastian Deutsch | May 27, 2008 1:53 pm | |
| Sebastian Deutsch | May 27, 2008 3:58 pm | |
| Stanislav Malyshev | May 27, 2008 4:10 pm | |
| Jani Taskinen | May 27, 2008 4:14 pm | |
| Stanislav Malyshev | May 27, 2008 4:18 pm | |
| Sebastian Deutsch | May 27, 2008 4:21 pm | |
| Rasmus Lerdorf | May 27, 2008 5:27 pm | |
| Andrei Zmievski | May 27, 2008 5:48 pm | |
| Sebastian Deutsch | May 27, 2008 6:09 pm | |
| Greg Beaver | May 27, 2008 7:43 pm | |
| Philip Olson | May 27, 2008 8:45 pm | |
| Stanislav Malyshev | May 27, 2008 11:15 pm | |
| Antony Dovgal | May 27, 2008 11:21 pm | |
| Stanislav Malyshev | May 27, 2008 11:25 pm | |
| Antony Dovgal | May 27, 2008 11:28 pm | |
| Derick Rethans | May 27, 2008 11:31 pm | |
| Rasmus Lerdorf | May 27, 2008 11:43 pm | |
| Pierre Joye | May 27, 2008 11:52 pm | |
| Antony Dovgal | May 28, 2008 12:11 am | |
| Hans Åhlin | May 28, 2008 12:14 am | |
| Derick Rethans | May 28, 2008 12:19 am | |
| Alexey Zakhlestin | May 28, 2008 12:24 am | |
| Antony Dovgal | May 28, 2008 12:32 am | |
| Stanislav Malyshev | May 28, 2008 12:33 am | |
| Antony Dovgal | May 28, 2008 12:41 am | |
| Stanislav Malyshev | May 28, 2008 1:02 am | |
| Antony Dovgal | May 28, 2008 1:14 am | |
| Stefan Walk | May 28, 2008 1:32 am | |
| Lukas Kahwe Smith | May 28, 2008 1:43 am | |
| Lokrain | May 28, 2008 1:47 am | |
| Stan Vassilev | FM | May 28, 2008 2:34 am | |
| Jon L. | May 28, 2008 2:35 am | |
| David Zülke | May 28, 2008 2:54 am | |
| Lokrain | May 28, 2008 2:58 am | |
| Felipe Pena | May 28, 2008 4:27 am | |
| Ford, Mike | May 28, 2008 4:34 am | |
| Greg Beaver | May 28, 2008 4:57 am | |
| Richard Quadling | May 28, 2008 6:13 am | |
| Brian Moon | May 28, 2008 8:20 am | |
| Andi Gutmans | May 28, 2008 8:28 am | |
| Andi Gutmans | May 28, 2008 8:28 am | |
| Chris Stockton | May 28, 2008 8:56 am | |
| Mike | May 28, 2008 10:10 am | |
| Jani Taskinen | May 28, 2008 10:25 am | |
| Chris Stockton | May 28, 2008 10:54 am | |
| Brian Moon | May 28, 2008 11:06 am | |
| Jared Williams | May 28, 2008 11:30 am | |
| Gregory Beaver | May 28, 2008 12:11 pm | |
| Pierre Joye | May 28, 2008 12:32 pm | |
| Chris Stockton | May 28, 2008 12:43 pm | |
| Stanislav Malyshev | May 28, 2008 1:06 pm | |
| Stanislav Malyshev | May 28, 2008 1:16 pm | |
| Rasmus Lerdorf | May 28, 2008 9:31 pm | |
| Derick Rethans | May 29, 2008 3:56 am | |
| Derick Rethans | May 29, 2008 4:03 am | |
| Pierre Joye | May 29, 2008 4:10 am | |
| Marcus Boerger | May 29, 2008 5:48 am | |
| Brian Moon | May 29, 2008 7:54 am | |
| Jonathan Bond-Caron | May 29, 2008 8:02 am | |
| Sebastian Deutsch | May 29, 2008 9:13 am | |
| Johannes Schlüter | May 29, 2008 11:55 am | |
| Johannes Schlüter | May 29, 2008 12:05 pm | |
| Chris Stockton | May 29, 2008 1:32 pm | |
| Johannes Schlüter | May 29, 2008 2:44 pm | |
| Jani Taskinen | May 29, 2008 3:06 pm | |
| Stanislav Malyshev | May 29, 2008 4:03 pm | |
| Lester Caine | May 30, 2008 12:04 am | |
| Pierre Joye | May 30, 2008 2:00 am | |
| Sebastian Deutsch | May 30, 2008 8:19 am | |
| Philip Olson | May 30, 2008 9:14 am | |
| Sebastian Deutsch | May 30, 2008 9:23 am | |
| Lars Strojny | May 31, 2008 5:27 am | |
| Hans Åhlin | May 31, 2008 6:17 am | |
| Hans Åhlin | May 31, 2008 6:26 am | |
| Hans Åhlin | May 31, 2008 6:38 am | |
| Chris Stockton | May 31, 2008 8:42 am | |
| Sebastian Deutsch | May 31, 2008 8:42 am | |
| Lars Strojny | May 31, 2008 9:33 am | |
| Stanislav Malyshev | May 31, 2008 10:45 pm | |
| Marcin Kurzyna | Jun 1, 2008 5:23 am | |
| Rodrigo Saboya | Jun 2, 2008 12:29 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [PHP-DEV] Re: Short syntax for array literals [...] | Actions... |
|---|---|---|
| From: | Chris Stockton (chri...@gmail.com) | |
| Date: | May 28, 2008 10:54:33 am | |
| List: | net.php.lists.internals | |
Hello,
On Wed, May 28, 2008 at 10:25 AM, Jani Taskinen <jani...@sci.fi> wrote:
Exactly. Open this can of worms and soon PHP is something else than easy to learn.. someone already mentioned that {} thing for objects.. :)
Sidenote: There are more important things to solve in PHP 5.3 (and especially HEAD) than adding this little syntax sugar..
--Jani
It's not syntax sugar, it's a construct which is used across many other languages. It will improve the language for other people and might help people to learn PHP. If we have resource issues commiting one line of grammar the project has other issues to deal with.
Mike wrote:
In my opinion I don't think PHP would be where it is today if it wasn't for being so easy to learn and use.
I attribute this directly to the fact that it didn't use a lot of "syntax sugar" that is unreadable and can't be "Googled" for. You can't Google "[]", and my guess is searching PHP.net for "[]" won't return anything useful either. Using Array() is SELF EXPLANATORY! Anyone can see that, search Google for "Array" and learn something about it. How many man hours are going to be wasted: 1. Searching for what the heck [] actually is.
Anyone who has gotten to a level of knowing how to assign php variables will likely have any troubles understanding what: $config = ['smtpHost' => 'example.org']; $oSmtp = someSmtpTransport($config['smtpHost']);
Is doing, and if you have a super complex multi-dimensional array, regardless of brackets or array syntax it will be hard to understand by a php new comer.
2. Explaining to people that [] is the same as Array.
$foo = Array('foo' => 'bar');
var_dump($foo); $foo = ['foo' => 'bar']; var_dump($foo);
Explained.
3. Changing coding standards for projects to prevent [] from being used.
4. Enforcing coding standards for projects to prevent [] from being
used.
$str = "$var {$foo} " . $bar . " $see " . ' tconst ' . $not . ' $parsed ';
We already face issues with more then one way to do things, we deal with it and it has not proven to be to difficult.
5. Trying to change [] back to Array in hopes of getting code to work on older versions of PHP.
If your projects target versions are older versions then create backwards
compatible code just like you do with PHP4 classes and PHP5 classes.
6. All the man hours wasted on it ALREADY that I'm sure could be much better spent getting PHP 5.3/6.0 out.
The discussion is the wasted time, not the code or implementation.
There are enough roadblocks and other things to worry about already, why would we want to add MORE? Especially for something with so little to gain (if anything at all).
Gain to whom? Remember, their is an entire community of developers out
their besides the people on this list who are accustomed to such use for arrays. Also, a community of developers who would like an alternative syntax to array to clean up their code a little, like me.
This isn't about "well if you don't like it, don't use it" either, because no matter what it will be forced on people who don't like it eventually. People who like it will be constantly changing Array() -> [] and people who hate it will be constantly changing [] -> Array(). More wasted time.
Just like string literals $str = 'foo'; and $str = "foo";
class Foo { public $bar; public $baz; public $qux;
VS
class Foo { public $bar, $baz, $qux;
$obj = new Stdclass; $obj = (object) NULL;
Really guys my only point is that we should not disregard a proposal for the sake of having more then one way to do something. That is the beauty of PHP and any successful language, it appeals to a wide variety of coding standards, methodologies and paradigms. If you just think about it you can name tons of things in PHP that let you do the same thing with two syntax's. This is part of php's success. Some things are easier for people to learn then they are for others.
-Chris







