Re: [RFC] Square brackets shortcut
| From: | Derick Rethans | Date: | Thu, 10 Jan 2008 20:09:33 +0000 |
| Subject: | Re: [RFC] Square brackets shortcut | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34664@lists.php.net to get a copy of this message | ||
On Thu, 10 Jan 2008, Hannes Magnusson wrote:
> So you reject scalar type hinting because it isn't type casting and
> can therefor confuses newbies - but scattering seemingly random
> brackets around your code (to safe 5 key strokes) is obvious to users?
>
> Noone would confuse this with named arguments?
> Why can't I do function foo([] $array) {} ?
>
> foo([]);
> $var = [];
> Is this really readable?
>
> Are you really serious about this?
I have to agree with this. It looks all cool and nice and stolen from
another language. But in the long end, all this does is saving you 5
chars to type, and lose a hell of a lot readability in the meanwhile.
(In case it's not obvious: -1)
regards,
Derick