[Insight-developers] Proposal to change file naming conventions

Johnson, Hans J hans-johnson at uiowa.edu
Tue Apr 19 22:13:22 EDT 2011


Hello All,

I have a proposal for easing development of ITK for many development environments.

A reference implementation is given:
http://review.source.kitware.com/#change,1450

PREMISE:
The  use of the .txx file extension for indicating the file that is to hold the implementation of a template class is only adopted by the ITK community and VNL communities (and has  slightly “infected” a few other small components of other projects).
Increasingly tools are being created to help the programmer better understand and analyze, and provide hints to proper coding options dynamically in the development environment (color coding, auto-completion).  The obscure .txx file requires special configuration of each development environment tool to indicate that it is really a c++ header.  For new developers this is often a difficult and frustrating task.  This is confirmed by the large amount of documentation for just a few of the common editors.  Tools that recognize and respect the .hpp extension (or “-ipl.h”):  uncrustify, vim, emacs, VisualStudios, clang, SlickEdit, kwrite, etc....)  None of these tools recognize the .txx extension without end user customizations.

CONS:
--Many files will be changed, and it will not be backwards compatible for those who accidently included the “.txx” files in their projects.  The .txx files should not be included in external packages

BENEFITS:

n  Implementation files are properly mapped to C++ language type by default for improved development environment experience.

n

CONSIDERATIONS:
There is no obvious single correct solution, but in general a common theme from other guides is that the final extension should be “.hpp” or  some suffix that ends with “.h”.  The extension should be all lower case letters (to avoid problems on case insensitive file sysetms).
http://www.parashift.com/c++-faq-lite/coding-standards.html

http://www.cplusplus.com/forum/beginner/5882/

“Back in the old CFront days, there was a .C and .H convention for C++ source and header files to avoid conflict with .c and .h for C. However, MS-DOS used a case-insensitive file system and soused .cpp and .hpp instead. Visual Studio's parser still recongnises .hpp and .inl as C++ files, so it's not a completely forgotten form.”

http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#The_-inl.h_Files

PROPOSAL:
In ITKv4 (and outside of the ThirdParty directory) change all implementation files that currently have a “.txx” extension to have a “.hpp” extension.



________________________________
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/mailman/private/insight-developers/attachments/20110420/9d50643e/attachment-0001.htm>


More information about the Insight-developers mailing list