What will happen if a custom module has the same name as a contrib module? What are the consequences of two modules sharing the same machine name?

For instance, if I write a custom module named 'views' and do not have the contrib module 'views' enabled, will the update manager attempt to update my custom module according to the contrib project status?
I write a custom module named 'views' and do not have the contrib module 'views' enabled, will the update manager attempt to update my custom module according to the contrib project status?


No it won't. The update manager looks at the packaging information added to the .info file for released modules, as long as your module doesn't have that data in the .info file (no reason why it would), then you won't have any problems.

The other answers are of course correct insofar as you can't have both modules enabled at the same time. You'd never even get to the point of seeing the fatal errors though, Drupal simply wouldn't let you install a module that has the same machine name as another module that's already installed.

You should aim to name your modules differently than the most popular module in existence, though, if only to save the sanity of the poor developer who eventually takes over the project from you.