Stop sending patches with underbars, please

Matt Mackall mpm at selenic.com
Tue Jan 6 11:23:44 CST 2009


Underbars are ugly, hard to type, and against the Mercurial coding
style. Stop using them, please.

It is important to have a consistent naming scheme for multiple-word
identifiers. This keeps us poor coders from having to double-check the
exact typography of identifiers every time we want to use them.
I know it's "foo bar" and I don't want to have to search through the
code to discover whether I'm looking for foobar, fooBar, FooBar,
foo_bar, Foo_bar, etc. We only use the foobar style here, period.
Consistency of style greatly outweighs the (very small) readability
concerns.

We do use a single leading underbar to mark identifiers as module or
class local. 

For the same reason, we don't capitalize anything, including class names
(but you probably shouldn't be adding a class anyway). The only
exception is Exceptions, which are capitalized.

ps: consider Python's own dict type which has iteritems, iterkeys,
itervalues, popitem, setdefault, fromkeys, but has_key.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list