Clarify use of underscores in HACKING

Ian Clatworthy ian.clatworthy at internode.on.net
Thu Jul 19 00:32:49 BST 2007


Aaron Bentley wrote:
> Ian Clatworthy wrote:
>> This patch is a small change to HACKING to better reflect the convention
>> used around underscores. I had been using an underscore to mean
>> "internal to this module" and a lack thereof to mean "external to this
>> module" when Robert explained to me that underscore really means
>> "internal to bzrlib".
> 
> I understand it as analogous to the "protected" keyword in C++.  These
> symbols may be used by subclasses, but should not be used from outside
> their class.
> 
> Yes, Tree._iter_changes is a shining exception.  There are a few others,
> too.  But in general, we should not be using _members outside their class.

That was certainly my expectation. One of the reasons I put up the patch
is because I don't particularly agree with it but, if it is our
unwritten convention, then I wanted to write it down and ensure it got
discussed/clarified.

Ian C.



More information about the bazaar mailing list