[drupal-devel] Why is there no designation between hooks and private functions in a module?

Carl McDade carl_mcdade at yahoo.com
Sat Mar 12 15:53:07 UTC 2005


Maybe gotten spoiled from working with Macromedia products where
everything in the core API is set with MM, but why is there no
designation between drupal hook functions and private functions?
Checking the docs is not useful especially given that the api changes so
often. Frequent changes are also the reason that memorization  does not
work. Marking core hooks and other would not cost anything and would
help in the creation and maintenance of contributed modules.

Changing:
function mymodule_validate(&$node) {

To:
function mymodule_dh_validate(&$node) {


Or:
function mymodule_validate_dh(&$node) {


_dh being the core designation would make th process of updating a
module easier also.

This might be a solution to a naming problem also in that all core code
must start with the designation. So anything after that can be used
including the underscore character.

Changing the hook invoke code has to be done but from the looks of it
this is not a big change.

Carl McDade







More information about the drupal-devel mailing list