[vtk-developers] vtk Coding style : Proposed change

Andrew Maclean andrew.amaclean at gmail.com
Mon Mar 27 18:14:35 EST 2006


John, 
   Sorry to have made you miserable. That was not intentional. 

Now my strong view is that Kitware maintains the code and they dictate the
style that we have to all fit in with. This style also has to be consistent
across the whole library because that is the style they are used to and they
maintain the code. The code also looks more professional if the style is
consistent.

In the case of the vtkParametric functions I spent a bit of time converting
to the Kitware style before submitting it. It did take some time. The reason
they ended up in Common and not in Graphics was that the builds failed
because the Graphics library was getting too big. I think this was the
reason but someone at Kitware could elaborate on this. I think they are in
the wrong place.

I have had many years of coding and teaching in various languages e.g. APL
(remember it? - write it one day, and on the next day wonder what you wrote
... but it must have been good!), Fortran, C, C++ to name some. The one
theme that has come through over the years is that consistency in coding
style is really important for library writers. The main reason for this is
that other programmers may/will maintain the code and, if the style is
consistent, their task is much easier. I have never assumed that I will be
the only person maintaining my code. 

Now personally:
1) Namespaces - great idea (I prefer them) but I honestly think that the
work involved in changing VTK over would be horrendous. Remember is it used
by so many applications both inside and outside Kitware. We have to be
pragmatic here.
2) The use of this-> - good idea, for one it prevents variable shadowing and
gives you flexibility in variable naming. Yes you can use m_ as a prefix or
_ as a suffix. Although the latter is probably not a good idea as it makes
it hard to read pointers e.g x_->y.
3) STL - good to see it making its way into the code.
4) Templating - should be more of it. However ... some of the older
compilers have troubles.


Ok -- all you people in the northern hemisphere ... get out and check out
the Spring ... I am sure it is great!

Regards
   Andrew

PS. Watch out for Mathieu - he is a bit of a devil when it come to checking
compliance with VTK coding standards. He is really strict!!!!


-----Original Message-----
From: John Biddiscombe [mailto:biddisco at cscs.ch] 
Sent: Tuesday, 28 March 2006 01:55
To: Prabhu Ramachandran
Cc: a.maclean at cas.edu.au; 'vtk-developers'
Subject: Re: [vtk-developers] vtk Coding style : Proposed change

Prabhu

Andrew's reply made my miserable, David's cheered me up and yours has 
also improved me.
> BTW, could you please turn off HTML emails, or you'll have to put up
> with quoting like what I have above.
>   
Sorry. It was specifically to highlight the change I proposed. I'll stop now

JB

-- 
John Biddiscombe,                            email:biddisco @ cscs.ch
http://www.cscs.ch/about/BJohn.php
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82





More information about the vtk-developers mailing list