Hi Paul,

Sadly using .h for C++ headers is not a solution, not all tools treat .h
files as C++, often they'll treat them as C headers.  Even worse once you
start looking beyond .h for a C++ header extension there is about a dozen
different variants that I've come across, and different tools recognise
different combinations of them.  With .h or .h or .hpp or .hxx or .HPP or
.HXX or .h++  what on earth do any of these mean to the non C++ coder?  H
langauge? HPP language? Non make any real sense, even .h for header, but
header for what? Its madness.  Yep extension less headers jump into this mad
mix, but at least its part of Standard C++ so should raise itself above the
throng in terms of legitimacy.

Personally I feel that if C++ headers and source files should have any
extension it is should be .C++ as this is the one one that fits with what
the majority of other languages do and it means something relevant to the
language.  However, the Standard C++ library didn't opt for this, for better
or for worse they choose extension less which is just as meaning free as the
rest of C++ header variants... However, it's very much part of Standard C++,
so I was never tempted to make a stand and use .C++ out of principle as were
already too many awful attempts at C++ header conventions.

Robert.

On Tue, Apr 8, 2008 at 8:48 PM, Paul Martz <[EMAIL PROTECTED]> wrote:

>  I agree that a "C++ IDE" should do the right thing for extensionless
> files and assume they are C++ -- especially in the case where they are
> listed as headers in the currently open project, for crying out loud :-).
> However, C++ IDEs aren't the only problem...
>
> Consider any one of dozens of general purpose text editors with support
> for source code syntax highlighting, which someone might use not just for
> editing extensionless headers, but also for editing raw text files with
> extensionless names like "readme," "passwd," and "mnttab". Obviously I don't
> want C++ syntax highlighting in just any old file that happens to not have
> an extension. Files with extensionless names have existed long before C++,
> and many are still around today that have nothing to do with C++. It was a
> mistake for C++ to try to claim extensionless files as their own, a mistake
> that currently plagues us on this list in the form of quarterly discussions
> on the subject.
>
> Although adding ".h" extensions to OSG headers would go a long way towards
> eliminating this regular discussion topic, I'm certainly not calling for a
> change: I'm an old timer, who grew up writing code with black teletype text
> on rolls of white paper and punched cards (later, green CRT text on a black
> background), so I could care less whether syntax highlighting is available.
> Besides, as we all know, changing the headers to use .h is well-nigh
> impossible at this point, it would completely alienate the existing user
> base. However, I think lacking the ".h" extension is a mistake that I would
> rectify, were I to write a next-generation scene graph.
>    -Paul
>
>
>
>  ------------------------------
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Robert Osfield
> *Sent:* Tuesday, April 08, 2008 12:58 PM
> *To:* OpenSceneGraph Users
> *Subject:* Re: [osg-users] why arent the ".h" postfix used in
> openscenegraph?
>
> On Tue, Apr 8, 2008 at 4:58 PM, Paul Martz <[EMAIL PROTECTED]> wrote:
>
> > As others have stated, the compiler doesn't care about the header
> > extension and enforces no "standard" extension. Therefore, those of us in
> > OSG can do whatever we want. Indeed, the osgPlugins routinely use a ".h"
> > extension for their header files. The absence of an extension
> > creates problems for code editors that present non-intuitive interfaces for
> > controlling syntax highlighting. Appending ".h" to OSG headers would
> > eliminate this confusion.
> >
>
> There is a key difference between plugins and the includes is that plugins
> are not at all public so consistency is less critical, where as the include
> directories are the public face to the library so that everything has to be
> consistent, and in the OSG case its consistent with Standard C++ headers.
>
> As for using .h for telling editors that its a C++ file... well some
> editors interpret it as C file and apply different syntax highlighting than
> they do if its a C++ file.  This is the reason why so many silly extensions
> for C++ files came into existence.   Frankly if a modern C++ IDE doesn't
> interpret an extension header as C++ then its pretty dumb as the standard
> library itself has extensionless headers, one really has to question how
> well it supports Standard C++ if doesn't properly handle this basic fact of
> C++.
>
> Robert.
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to