On Jan 10, 2008 9:39 AM, Sam Barrow <[EMAIL PROTECTED]> wrote:
> On Thu, 2008-01-10 at 14:56 +0100, 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 don't think the only benefit in this would be to save keystrokes. I
> think it looks better, and makes code more readable, whereas the current
> way just looks like a function call.

    Not only do I agree, but I'll also refer anyone wondering how well
it would really be adopted due to the initial difficulty in
recognizing the structure to the ternary operator.  Unless it's an
obvious condition and result, ternary operation itself is equally - if
not more - trivial to initially figure out than $a = [1,2,3];.

-- 
</Dan>

Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since 1979.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to