On 12/20/07, Antony Dovgal <[EMAIL PROTECTED]> wrote:
> > you prefer cluttering namespace with a lot of oneliners?
>
> Oh, come on.. Since when do we call it "cluttering"?
> Is there some kind of limit on number of functions in a namespace?
>
> Why limit yourself and "inline" the function instead of putting it
> into a nice library of utility functions?

it doesn't make sense to put some of these functions in libraries,
because they are really once-used.

another good reason is, that optimizer can safely inline this function
by eliminating function call at all (using cycle as an internal
representation, while letting keep short one in source)

> > currently, people prefer to use explicit cycles instead of
> > array_map/array_filter and that looks ugly (hides actual logic behind
> > syntax), but at least it is not as slow as create_function.
>
> Whatever people currently use - it's their choice.
> If you think that people would magically switch to the new syntax (if we 
> decide to
> add it after all) in a moment, I'm afraid I have to upset you - this will not 
> happen
> in the next 10 years because of many reasons, so people would still use the 
> good
> old syntax they're used to.
>
> So here is what we _actually_ get with this anonymous function syntax:
> 1) Yet another way to make the code unreadable and overcomplicated.
it is not unreadable. it is perfectly readable for people with
modern-languages background (and I don't mean 1 or 2 languages, I mean
majority)

> 2) Yet another incompatible syntax you cannot use if you need to support 
> older PHP versions
> (and you can't check for it in runtime, since this is a compile time thingie).
yes

> 3) 10 people happy because they got a new toy.
"thousands" is a closer number

-- 
Alexey Zakhlestin
http://blog.milkfarmsoft.com/

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

Reply via email to