Matthew Ratzloff wrote:
> I think all functions should begin with a verb, but "isSet"
> seems more natural than "isKey" in this situation, since the
> array is a product of how PHP handles POST data, not inherent
> in the HTML itself.

You make a good argument. :-) The isSet() name seems good.

> If I can continue to be pedantic for a moment, "noTags" and
> "noPath" aren't good function names either. They should be
> "removeTags" and "removePath" or something similar.

The original intent wasn't to begin strictly with a verb, although I can
see some value in that. Rather, prefixes were chosen to be:

1. Unique - With fewer prefixes and clearer organization, utility can be
easily remembered. By forcing ourselves to stick to very few prefixes,
it also guides us toward consistency.

2. Descriptive - In addition to being easy to remember, prefixes are
hopefully intuitive in the first place.

3. Short - The shorter, the better.

This gave us "is" (whitelist), "no" (blacklist), and "get" (blind).

Because methods/functions that begin with "is" traditionally return
strictly boolean (not just something that can be used as a boolean, such
as the return value of mysql_query()), "test" was added to describe the
unique utility within Zend_Filter_Input, where only valid values are
released from the cage. So, "test" is essentially the same as "is" with
one added feature.

Anyway, you can blame me for the current convention. If others would
also prefer changing "no" to a verb, maybe that's something we should
consider. I personally like it as it is.

Chris

Reply via email to