On 01-06-2012 13:34, Gustavo Lopes wrote:
On Fri, 1 Jun 2012 12:58:37 +0200, Pierre Joye wrote:
On Fri, Jun 1, 2012 at 10:02 AM, Benjamin Eberlei
<kont...@beberlei.de> wrote:
How about IntlBreakIterator? I agree with David that the naming is very
weird, it doesn't hint at something from Intl but another crazy spl
iterator :-)

Asides from date related classes -- which could be confused with stuff
from ext/date or even ext/calendar --, no other classes have Intl in
their name. Does SpoofChecker hint at something from intl?
ResourceBundle? ICU is a rather large library, and while
internationalization is a common theme, the APIs have diverse
functionality and therefore diverse names. Plus, SPL does not have a
monopoly on the *Iterator names.

I agree too. BreakIterator is a very common name and I suspect
possible naming conflicts may happen.


So would you have RuleBasedBreakIterator renamed
IntlRuleBasedBreakIterator too?... I find it very hard to believe that
"BreakIterator" is "a very common name", but I'm open to evidence that
points otherwise. This argument could maybe be made for
'Transliterator', which was added in 5.4.

In my personal opinion, all Intl classes should be prefixed with Intl. It's not so much that BreakIterator is a very common name, but rather a very ambiguous name that may point to many different things. Just by the fact that multiple people have already posted here that at first they thought BreakIterator had something to do with the break statement gives you a rather solid hint that the function of this class is not immediately clear. Prefixing it with Intl immediately makes it clear that it belongs to the Intl superfamily, and limits the potential misunderstandings a lot. I actually still don't understand why not all Intl classes are prefixed? Isn't that the usual procedure? eg. for MySQLi, and pretty much all other extensions?

- Tul

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

Reply via email to