[Insight-developers] Request for Comment: ITK Style rule that typedefs need to be aligned
Johnson, Hans J
hans-johnson at uiowa.edu
Fri Feb 1 12:36:54 EST 2013
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<mailto: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.
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20130201/2dfdd30c/attachment.htm>
More information about the Insight-developers
mailing list