[Insight-developers] Proposal to change file naming conventions

Bill Lorensen bill.lorensen at gmail.com
Tue Apr 19 23:42:39 EDT 2011


Hans,

This is an interesting proposal. And I think it is backwards compatible.

However, .hpp is a bit confusing since we already use .h. I believe
that projects usually choose one or the other, but not both. Users may
get confused as to which to include, especially if their projects are
using .hpp for "include" files. Do you have an example of a project
that uses both .h and .hpp files?

Perhaps we should look harder for a better convention.
For example, eigen just has .h files. The equivalent of our .txx is
kept in the .h file.
Also wtl uses the same convention. Also tclap.

Bill

On Tue, Apr 19, 2011 at 10:13 PM, Johnson, Hans J
<hans-johnson at uiowa.edu> wrote:
> 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.
> ________________________________
> _______________________________________________
> 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.html
>
> 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
>
>


More information about the Insight-developers mailing list