Why we don't use underbars

Martin Geisler mg at aragost.com
Fri May 6 02:23:38 CDT 2011


Matt Mackall <mpm at selenic.com> writes:

> On Thu, 2011-05-05 at 20:48 +0200, Sune Foldager wrote:
>> On Thu, May 05, 2011 at 01:38:49 -0500, Matt Mackall wrote:
>> >On Thu, 2011-05-05 at 12:12 +0200, Sune Foldager wrote:
>> >
>> >The standard is: don't use underbars in identifiers. Believe it or
>> >not, this standard was conceived with full awareness that there are
>> >in fact lots of underbars in the current code. That is the whole
>> >point: to get rid of them.
>>
>> Yes, lovely. It looks cool with REVLOGDEFAULTVERSION and such; it's
>> not like the letters run together or anything ;-).
>
> I'm perfectly aware of that, but I've made a conscious and measured
> evaluation that being able to remember that "foo bar baz" is
> "foobarbaz" and not "foo_bar_baz" without needing a reference and
> without getting runtime errors completely trumps the minor readability
> nuisance.[1]

My feeling is that we have to look at the code anyway to remember the
name of the constant. We might memorize the name of the constant after a
while, but that includes memorizing the position of any underbars. At
least this is my experience.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/


More information about the Mercurial-devel mailing list