[Insight-developers] Request for Comment: ITK Style rule that typedefs need to be aligned

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Feb 1 20:29:16 EST 2013


I agree with everyone :)

This style is a huge pain. But it does make things look a little better.

What about a compromise? Perhaps we can enforce it in the header but not the implementation files. I think that could easily be done with KWStyle rules.

Brad

On Feb 1, 2013, at 12:36 PM, "Johnson, Hans J" <hans-johnson at uiowa.edu> wrote:

> Hello ITK community,
> 
> I'd like to take a poll about your feelings regarding an ITK style decision that has been in place for a very long time.
> 
> The ITK style guide states that all typedefs that are on adjacent lines MUST be justified the same.  While I think that this is often a good practice, this rule also obfuscates the code sometimes, and it makes unnecessary changes in code that is unrelated to the line of code in question (for example, if an internal type name is renamed to better represent the code, the 10 typedefs around that one also need to change).
> 
> As a side note, the "Clean Code" book advices against such alignement as it emphasizes a relationship between the elements in a column. It should instead emphasize the relationship between the elements in a row (when you look at those lines, it's usually to know what is the type of the variable -> horizontal relationship).
> This also has 2 practical limitations:
> - when the variable type or name are long too long that it reach the number of characters per line.
> - adding a new type with a name longer than the existing forces all the other rows to be changed, which adds noise into the history.
> 
> NOTE:  Making this change in style policy will NOT require any code to be changed.  It does allow more flexibility in the future.
> 
> ============================
> Please respond to this message so that a historical record of this proposals pro's/con's can be recorded on the mailing list.
> 
> Thanks,
> Hans
> 
> 
> 
> =================================================================
> Hans J. Johnson, Ph.D.
> Assistant Professor, Department of Psychiatry
> 
> Mailing Address:
> W274 GH                             Email: hans-johnson at uiowa.edu
> 200 Hawkins Drive                   Phone: (319) 353 8587
> The University of Iowa
> Iowa City, IA 52242
> 
> 
> Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20130201/2b2dd8f8/attachment.htm>


More information about the Insight-developers mailing list