[development] Naming the CVS abstraction module

Larry Garfield larry at garfieldtech.com
Sun Jun 10 00:29:10 UTC 2007


On Saturday 09 June 2007, Angela Byron wrote:
> On 9-Jun-07, at 1:36 PM, Doug Green wrote:
> > Angie,
> >
> > Why is version_control preferred over versioncontrol?
>
> For legibility. It's consistent with our variable naming convention,
> and separating the individual words help non-English speakers who can
> babelfish individual words to figure out what a particular thing is
> doing.
>
> >   I thought we only
> > used the underscores when the module was extending another module.
> > And I
> > thought we had problems with hook functions related to underscores,
> > or is
> > the problem only related to hook's with underscores?
>
> I know of no such problems. The only thing I can think that would
> cause a problem is if you named a function something like
> my_module_insert and Drupal mistook it for a node insert hook when it
> was just a helper function or something. But mymodule_insert would
> have exactly the same problem.

It also makes it impossible to definitively extract the providing module from 
an arbitrary function name, because you don't know if you should break on the 
first or second underscore to get the module name.  That's a problem that I 
ran into with the menu-split patch in some iterations.  Sharing a namespace 
between modules and hook names is nasty and prevents a lot of useful 
introspection.  

+1 to versioncontrol.module, -1 to version_control.module.  I always avoid 
putting underscores in module names for exactly that reason.

-- 
Larry Garfield			AIM: LOLG42
larry at garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


More information about the development mailing list