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

Reply via email to