[vtk-developers] vtk Coding style : Proposed change

Will Schroeder will.schroeder at kitware.com
Mon Mar 27 11:25:51 EST 2006


Hi John-

Thanks for the (potential) contribution. Here's my take on the style issue.

I believe that for the benefit of the user community the code base 
should, as much as possible, look like it is written by one person. 
Obviously programming style has a lot to do with this, but so do design 
patterns, etc. The reason for this uniformity is that it benefits us as 
a community, once we learn a particular style and approach, it becomes 
much easier to understand, extend and maintain the code across the 
community. Sure, your approach helps you, but if I go into the code to 
fix a bug then I have to learn your style. (BTW, there are aspects to 
the VTK style that I don't like too, but I have learned to live with it.)

But before you throw up your hands (and use colorful cockney expletives 
;-) ) let's talk about alternatives. I have talked with several of you 
about creating some sort of VTK contrib repository for applications, 
modules, etc. that are not part of VTK proper but rather is a separate 
checkout. (ITK has something similar and it works okay.) The challenge 
in the past has been testing the code but I think we can figure out a 
way to work around this issue (i.e., we want to make sure that the 
contrib directory builds and tests on a daily basis and it doesn't 
degenerate into a mess). Also, resources and time are a problem but we 
have talked here at Kitware about committing some of our internal funds 
to facilitate activities like this. Of course, community support is 
necessary too. If such a VTKApplications or VTKContrib repository were 
created, we could loosen up style requirements, accommodate different 
copyrights, etc. with probably the strongest requirement that the 
software build/test using CMake and DART.

Comments?

Will

PS- On a separate but related note, Julien Jomier here at Kitware has 
created a separate tool called KWStyle that does style checking. Julien 
is slowly adding this tool to several projects including ITK (look for 
KWStyle on the ITK experimental builds). Contact Julien if you would 
like more information or would like to help.

John Biddiscombe wrote:
> Dear vtk developers,
>
> I have a number of modules that I would like to (and have been asked 
> to) contribute in the near to mid-term future but I do not wish to 
> reformat my code to fit the vtk coding style. If (for example) 
> vtkNetCDFReader is contributed to vtk/paraview, I will most likely be 
> doing the majority of maintenance and fixing work on the class(es). I 
> do not like the vtk coding style as I find it hard to quickly mentally 
> parse (bracket indentation in particular) and I would like to reserve 
> the right to use my own coding style on the contributed class(es). I 
> can digest and debug my own code considerably faster because I am 
> familiar with the way it is structured and laid out.
>
> I would like therefore to propose that the vtk coding style (as 
> described here http://www.vtk.org/Wiki/VTK_Coding_Standards ) be 
> modified to include the following (additional text in red - apologies 
> for non html capable email readers)




More information about the vtk-developers mailing list