Constant naming convention

Augie Fackler raf at durin42.com
Wed Dec 28 11:53:20 EST 2016


> On Dec 28, 2016, at 11:17 AM, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
> 
>> The sum of those things is that I’d prefer, in new code, to violate the oral-history-only (that is, not codified in a check-code rule or other formal coding style declaration) convention whereby constants are indistinguishable from variables,
> 
> Actually, the "all lower case, no underscore" rule is written down somewhere on the wiki:
> 
>  https://www.mercurial-scm.org/wiki/CodingStyle#Naming_conventions

Oh, and I just noticed: this wiki page doesn’t mention the word “constant” at all - were I reading this, it would not occur to me that “all identifiers: all lowercase with no underbars” applied to constants because that just sounds like madness to my brain. If we’re not going to change the policy, I think at a minimum this wiki page needs to call out constants as also lowercase and a check-code rule needs to exist.

(I’d still rather work out a plan rather than just defer the problem until October, especially for a style point this minor. Perhaps we should have a “what policy changes should we make” thread with the steering committee in the near future.)

Thanks!
Augie


More information about the Mercurial-devel mailing list