On 18 June 2013 23:21, Sherif Ramadan <[email protected]> wrote:
> Are you saying that it's better to have familiarity over functionality?
>
> I'm not sure I agree with this premise of we shouldn't provide
> better functionality just because it would make all the other poorly
> written functions look bad. That's setting a lower bar of standards, isn't
> it?
>
>
In this case, I have a strong doubt that the "better functionality" will be
used, nor that it is indeed "better" at all. I also much prefer,
aesthetically, the _key() API over appending a flags parameter: though that
is likely, largely due to the familiarity mentioned earlier. Quite frankly
the simpler, more familiar approach looks best to me.
Also, please don't put words into my mouth: nowhere did I say, "we
shouldn't provide better functionality **just because it would make all the
other poorly written functions look bad**" (emphasis mine).
I appreciate you having an alternative viewpoint, but try not to see what
isn't there. What I *was* saying is that the other functions are there,
they do a great job and have been for a long time. Why not make use of that
array-function-muscle-memory; put it to our advantage?
To swing over to the other side of the fence, I do see that the flags-based
approach would "work" just as well in terms of getting the functionality
out there. It is something I have thought about adding previously for a
number of other functions. The closest being adding PREG_GREP_KEY to
preg_grep(), which already has (only) PREG_GREP_INVERT. For that function,
a new flag would be the best option. For array_filter(), I'm not convinced
at all.