[torquedev] Changes to Formatting in TORQUE 2.3 and 2.4
josh at clusterresources.com
Wed Sep 3 14:12:36 MDT 2008
Several weeks ago Cluster Resources started investigating ways to improve the readability and
maintainability of the TORQUE source code. We decided that a good first step is to make the
formatting and style of the code more uniform. The problem is, of course, choosing a formatting
style which will also avoid a holy war amongst the programming religious. :) After much thought, we
decided that for the time being it makes the most sense for the TORQUE to adopt a Cluster Resources
C-code style of formatting. Since a few of you have expressed a dislike for this formatting style,
we wanted to let you know how we came to make this choice.
Our objectives in picking a format style were:
* The style would be consistent throughout the TORQUE code. This is the biggest gain.
* The style should use spaces instead of tabs for indentation.
* The style would help those who contribute/develop against the TORQUE code the most to be more
Of course, the CRI style satisfies bullets 1 and 2. Since CRI developers are currently the most
active contributors to TORQUE at this time, and we expect the number of CRI TORQUE developers to
increase over time, having them use the CRI style helps them be most productive. This not only helps
us, but also the community as a whole.
We don't expect everyone to like this decision and that is OK. Contributors can continue to
post/submit patches in whatever style they are comfortable with. When the code is to be checked into
a branch or trunk, however, we will modify it to conform with the new standard.
For those interested, the new standard was automatically applied using the tool "astyle". Here
are the command line args we used:
astyle -s2 -b --indent=spaces=2 -S -B --convert-tabs --indent-preprocessor --break-blocks
--pad=oper --unpad=paren --mode=c <FILENAMES>
We have already applied the formatting to TORQUE 2.4 (the trunk) and plan on formatting the
2.3-fixes branch shortly.
Hopefully this change will make the TORQUE source code easier to read and maintain. More
improvements can be made, but this is the first step.
Cluster Resources, Inc.
More information about the torquedev