[development] when we run out of characters

Karoly Negyesi karoly at negyesi.net
Tue May 16 18:59:19 UTC 2006


Hi!

We have a namespace problem. As PHP identifiers can have only letters,  
numbers and underscores we are using underscores for the hook identifier,  
ie. we have a hook_menu etc.

On the other hand, when a module is best described with more than one  
word, the words are separated by underscores. This can lead to clashes,  
like foo.module defines a function called foo_bar_that and when  
foo_bar.module would like to implement the newly introduced hook_that....  
then we have a problem. This already means that if you have a foo.module  
then you are better not using any function that's called foo_X_hookname.

We discussed several solutions on IRC.

One of them is using double underscores somewhere. But where? If you use  
them as hook identifiers you have 35K LoC in core to look through (and  
change a significant percentage). It will be fun, fun, fun! It's visually  
very confusing to rename taxonomy_menu to taxonomy__menu because then the  
hook_menu will look like taxonomy__menu_menu and the two menus look as if  
they belong together.

So, that won't work.

Another solution is to use zero underscores somewhere. But where? Again,  
changing core is not a good option, and I won't like hookmenu instead of  
hook_menu.

So, with perfect logic we arrived to a very ugly point: we shall rename  
axonomy_menu to taxonomyMenu . Do I like this? _No_! But...

Regards

NK


More information about the development mailing list