David

This is the reason I've always been very against using db_query("DELETE FROM {variable} WHERE name LIKE 'modulename_%'"); in a module's hook_uninstall. I always use variable_del() on each variable itself. It's how core handles itself, so in my opinion that's how contrib should follow.

Dave Reid
dave@davereid.net


On Sat, Oct 16, 2010 at 11:34 AM, David Cohen <drupal@dave-cohen.com> wrote:
Hey, I'm wondering what the community thinks about this...

I feel that if I have modules/foo/foo.module checked into drupal.org CVS
and drupal.org/project/foo, then this module stakes a claim to the
foo_... namespace.  That is, I can name my functions foo_whatever
without worrying that some other module out there already defines the
same function.  Similarly, I can name my variables foo_whatever,
database tables, and so on.

Now, let's say someone else checks in a module called foo_bar.  And say
both modules define the same function, variable or other namespace
collision.  What then?  Is that a bug, and if so which module is
responsible for fixing it?

If you want a concrete example, both fb.module and fb_social.module
define variables starting with "fb_", and specifically I wonder how to
respond to http://drupal.org/node/943462.

I don't want to start a flame war. I'm curious if there is community
consensus or official policy.  Personally I think its a bad idea to name
any module with an underscore.  That is, drupal.org/project/foo_bar
should instead be drupal.org/project/foobar, as this avoids any
confusion.

-Dave