[vtk-developers] vtk Coding style : Proposed change

Lisa Avila lisa.avila at kitware.com
Mon Mar 27 11:47:53 EST 2006



>>OK. I'm prepared to reword it and reduce the scope to indentation, scope 
>>of brackets etc, but I'd like more than 78 chars across the screen. Give 
>>me a concrete reason to limit to 78. does vi only handle this many. I 
>>don't believe it! Do you mean only comments, or long if statements too?

We should NOT mix indentation styles that have the bracket on the preceding 
line of code vs. styles that have the bracket on their own line 
(VTK-style). I know there are complaints about taking up too much vertical 
real estate, but it really does make the code easier to read / debug. Also, 
there is great value when working with (and maintaining) a very large 
software library such as VTK in knowing exactly what the code should look 
like.

Styles that leave out the brackets are unacceptable for many reasons 
including debugging issues and macro problems but also the fact that this 
throws off code coverage calculations.

So - if we agree that the brackets need to be on their own line, and they 
need to be there, then we are just arguing about indentations. Assuming we 
agree on two spaces as the standard indent, we are simply arguing over 
whether the bracket is indented with the code it encloses or the enclosing 
block. :-)

One note on the issue of who maintains code: Keep in mind that anything 
checked in to VTK that becomes part of an official release is maintained by 
Kitware. Sure - if a user on the mailing list complains of a problem you 
probably will look into it and fix it. If a support customer complains of a 
problem, we have to look into and fix it. Or if we, for example, make a 
major revision to the pipeline :-) we need to dig into your code to revise 
for the change.  This is why we have a good incentive to be strict on the 
coding style.

Lisa








More information about the vtk-developers mailing list