Why we don't use underbars

Matt Mackall mpm at selenic.com
Fri May 6 09:36:15 CDT 2011


On Fri, 2011-05-06 at 09:51 +0200, Sune Foldager wrote:
> On Fri, May 06, 2011 at 09:48:09 +0200, Dirkjan Ochtman wrote:
> >On Fri, May 6, 2011 at 09:46, Martin Geisler <mg at aragost.com> wrote:
> >> The coding style could go both ways: with or without underscores. If I
> >> have to remember the words anyway, then it's just a matter of doing
> >
> >Sure, but the coding style is what it is, changing it now would only
> >make things worse.
> >
> >Please stop bikeshedding now and just accept the way Mercurial has
> >been doing it for 6 years?
> 
> So what's the policy on this:
> 
> EXISTING_FLAG = 2
> NEWFLAG = 4

Feel free to refactor stuff when you encounter it. That's how we evolve
the code towards being consistent. Odds are that should probably become:

_existingflag
_newflag

..because the standard is lowercase identifiers, prefixed with _ when
they're intended to be module-local.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list