[Insight-developers] cvs check-in verification

Blezek, Daniel J (GE, Research) blezek at crd.ge.com
Mon Jun 26 14:52:28 EDT 2006


Stephen,

  To break or not to break: that is the question.

  Just as you tend to break long lines, I tend to join up broken ones, and I a prefer the Java standards on {}:

  for () {
   doIt();
  }

Rather than ITK:

  for()
    {
    doIt();
    }

as the Java way is more compact.  So the long line / broken line / paren location are standards for a given project.  I'm happy to code using the paren style and keep my lines to 80 characters, if we reach consensus and set it as a standard.  But watch out for:

typedef itk::ShapedNormalizedCorrelationImageFilter<DSlice,Slice,DSlice,double> DShapedNCFilter;

Which is an entirely plausible typedef and is 96 characters long, without indentation.  (ShapedNormalizedCorrelationImageFilter is something I'd been considering contributing to ITK...)

I don't like the looks of this, but that's my personal preference:

typedef itk::ShapedNormalizedCorrelationImageFilter<Slice,
						    Slice,
						    DSlice,
						    double> ShapedNCFilter;

-dan

-----Original Message-----
From: Stephen R. Aylward [mailto:Stephen.Aylward at Kitware.com]
Sent: Monday, June 26, 2006 2:27 PM
To: Blezek, Daniel J (GE, Research)
Cc: Lorensen, William E (GE, Research); Julien Jomier; Insight
Developers List
Subject: Re: [Insight-developers] cvs check-in verification


Hi Dan,

:)  Your changes to the logger code are what prompted my email :)   The 
helper functions you added have lines longer than 100 characters and 
many opportunities to break them to less than 80 characters.

Isn't it, with VIM and emacs, that either (1) they wrap at 80 characters 
and look ugly (breaks visual formatting - making it harder to understand 
code written by others) or (2) you have to do a horizontal scroll or (3) 
you have to cursor to the line to see the rest of a long line?

These visual breaks and unnecessary movements are what prompted us to 
have an ITK design spec that "requires" an 80 character line limit.

I'm definitely open to there being exceptions to the rule - I am certain 
they exist and Bill will find them, but they should be exceptions... 
Many users (not just you by any means - you just set yourself up and I 
couldn't resist :) thanks :) ) don't follow the rule, so I think we need 
to consider new ways of upholding our standards (that really sounds 
pompous, but long lines are a pet peeve :) ) - ask Julien - I've been 
reformmating his code for years :)

Thanks,
Stephen

Blezek, Daniel J (GE, Research) wrote:
> My $0.02:  I personally dislike lines that are cut at 80 characters, seems to be a holdover from the bygone era of punch cards and Fortran.  And when was the last time you printed source code?  Xemacs is very good at handling long lines.
> 
> Of course I've never done punch cards and my monitor(s) resolution is 3200x1200 resolution...
> 
> -dan
> 
> -----Original Message-----
> From: insight-developers-bounces+blezek=crd.ge.com at itk.org
> [mailto:insight-developers-bounces+blezek=crd.ge.com at itk.org]On Behalf
> Of Lorensen, William E (GE, Research)
> Sent: Monday, June 26, 2006 1:48 PM
> To: Julien Jomier; Stephen R. Aylward
> Cc: Insight Developers List
> Subject: RE: [Insight-developers] cvs check-in verification
> 
> 
> I think there may be cases where we have to exceed 80 characters.
>  I'll see if I can find an example.
> 
> Bill
> -----Original Message-----
> From: insight-developers-bounces+lorensen=crd.ge.com at itk.org
> [mailto:insight-developers-bounces+lorensen=crd.ge.com at itk.org]On Behalf
> Of Julien Jomier
> Sent: Monday, June 26, 2006 9:17 AM
> To: Stephen R. Aylward
> Cc: Insight Developers List
> Subject: Re: [Insight-developers] cvs check-in verification
> 
> 
> We should be able to use KWStyle from the command line for this.
> I'm going to test it on a local CVS and check with Andy on how to 
> install it for ITK's cvs.
> 
> Julien
> 
> Stephen R. Aylward wrote:
> 
>>Hi,
>>
>>What about adding CVS commit script to verify that none of the line 
>>lengths are beyond 80 characters?
>>
>>Some of the ITK code is hard to visually parse because line lengths are 
>>intermittently beyond 80 characters.   Seems to be happening more and 
>>more often.
>>
>>Stephen
>>
>>
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
> 

-- 
=============================================================
Stephen R. Aylward, Ph.D.
Chief Medical Scientist
Kitware, Inc.
http://www.kitware.com


More information about the Insight-developers mailing list