On Tue, Apr 8, 2008 at 3:48 PM, Paul Martz <[EMAIL PROTECTED]> wrote:
>
> 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.
>

FWIW, there's no actual requirement in C++ that "extensionless"
headers are actually without extension.  It would be perfectly
reasonable for #include <foo> to actually include a file named foo.hxx
.  The headers need not even exist.

Also, competent format verification schemes do NOT look at the file
extension.  Example:
    /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4 $ file algorithm
    algorithm: ASCII C++ program text

> 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.
>

I consider it much more worthwhile to use something that's *not* .h,
so that C++ headers are distinguished from those usable in both C and
C++ and better match the source file names.  Personally I prefer .hxx,
to go along with .cxx source files, but since .cpp is so common, .hpp
is perhaps a better choice.  (Even if cpp does mean C Preprocessor.)
*.?pp is a nice convenient glob, and even more so than can be done
with *.h headers.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to