Message: previous - next
Month: December 2014

Re: [trinity-devel] Codebase formatting discussion

From: Michele Calgaro <michele.calgaro@...>
Date: Wed, 31 Dec 2014 11:59:52 +0900
Hash: SHA512

On 12/31/2014 06:51 AM, Timothy Pearson wrote:
> All,
> This is a follow-up on point #5 from my post earlier this month entitled "TDE GIT thaw, build farm status, and
> future direction".
>> Codebase formatting.  While this is not a major problem for the users I have been tripped up more than once by
>> the fact that some portions of the codebase (twin among others) use a vastly different style of indentation and
>> bracing, one that is (IMHO) extremely hard to read and/or modify.  This in turn has therefore contributed to many
>> "fix up prior commit" commits and/or outright regressions in GIT.  I greatly prefer Stroustrup style formatting
>> with hard tab indentation (no space or combined space/tab indents) and indented public/protected/private blocks. 
>> This style is highly legible, emphasizes the control flow, and produces a minimal number of non-whitespace
>> difference lines when an if/else block is modified.  All of the new code (thousands and thousands of lines of
>> it) that I have contributed to TDE have been in this style.  I have been toying with reformatting the entire TDE
>> codebase in one large commit; if there are no objections I think this step could greatly improve both our 
>> development speed and the overall quality of the codebase; comments and discussion are welcome.
> I would like to start converting over the codebase ASAP.  I have an automated tool that will do this, but would
> like some feedback on the style to convert into as reformatting like this is a one-time operation that will not be
> repeated for the life of the TDE project.
> As mentioned above I strongly prefer a modified Stroustrup style formatting.  Is this acceptable to the other
> developers, and if not, what would you rather use and why?
> Thanks!
> Tim

Hi Tim, code reformatting is definitely something we have to do. I meant to come back with some style ideas/rules last
week but other things got into the way. Can you give me a few more days (say until Monday) to come back with my thought?
In the mean time, I think it would be useful if you share a small piece of code showing the code formatting that you
are thinking about.
Since the code reformatting is a "one time op", we should make sure we are all happy with the code style we choose.
Obviously this will require some compromise from each of us, since every one has its own preferences about style.


Version: GnuPG v1