[Vv] vv and clitk3 "coding standard"

David Sarrut David.Sarrut at creatis.insa-lyon.fr
Tue Apr 27 10:31:52 CEST 2010


right !

On Tue, Apr 27, 2010 at 09:36, Simon Rit <simon.rit at creatis.insa-lyon.fr>wrote:

> After working a bit on clitk3, I have the feeling that there is
> absolutely no consistency between (and even within) files. I don't
> really think we should adopt a coding standard because we should keep
> our own coding styles but it would be nice if we could just set a
> minimal set of rules for the sake of readability. I suggest these ones
> first:
> - indentation: 2 spaces
>

ok


> - tabs are replaced by spaces
>

ok, I have to search how to do that with emacs


> - opening and closing characters of a block are aligned vertically, e.g.
> if (true)
> {
> }
>

ok, personaly I prefer:
if (true) {

}
because it save one line. But as you wish.



> - types are suffixed with Type (as in ITK if I'm not mistaking)
>
ok


> - preprocessor defines and macros in upper case
>
ok

I will add a few more :
- all member functions start with an upper case (like vtk and itk, but
unlike QT !) : SetToto(a) and GetToto()
- all member variables start with m, eg : mToto or mTiti (unlike vtk, unlike
qt, unlike itk)
- delimitate the function (in cxx and txx) with comment like //------------
(see for example clitkBinarizeImageGenericFilter.txx)

that all for me.

If (when) we agree all : we can divide the repository, each of us will be
responsible to modify a part of the source code according to the guideline.


> For the rest (e.g. naming of functions and variables), we can try to
> follow the rules of our third-party libraries (itk and vtk). What do
> you think?
> Simon
> _______________________________________________
> vv mailing list
> vv at creatis.insa-lyon.fr
> http://www.creatis.insa-lyon.fr/mailman/listinfo/vv
>



-- 
David Sarrut, Phd
Chargé de recherche CNRS
Centre de lutte contre le cancer Léon Bérard
28 rue Laënnec, 69373 Lyon cedex 08
Laboratoire CREATIS-LRMN UMR CNRS 5220, Inserm U 630
Tel : 04 78 78 51 51 / 06 74 72 05 42
http://www.creatis.insa-lyon.fr/rio
______________________________________________
"2 + 2 = 5,  for extremely large values of 2"
______________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/vv/attachments/20100427/40f7cc94/attachment.html>


More information about the vv mailing list