![]() |
SGI had it right a decade ago!
I'm reading through the Inventor Mentor for SGI's Open Inventor (C++ OpenGL
binding). I just noticed they named their example file "Molecule.c++". This choice is so obvious and rational to me that I felt it wasn't even worth discussing. The only reason I haven't used the .c++ extention is that no one else seems to use it, and my tools don't recognize it. But now I see that SGI was doing it ten years ago. Why didn't this become the "standard"? ".c" means a C source file to both me, and my tools. I've noticed this is what Stroustrup uses on his website - much to my surprize. ".cpp" is quite common, and is used by both Trolltech and KDevelop. To me, "cpp" means the C preprocessor, so that convention seems wrong. Koenig and Moo use ".cc" which is the most agreeable convention I've seen in common use. But ".c++" is superior to all of these! -- "[M]y dislike for the preprocessor is well known. Cpp is essential in C programming, and still important in conventional C++ implementations, but it is a hack, and so are most of the techniques that rely on it. ...I think the time has come to be serious about macro-free C++ programming." - B. S. |
Re: SGI had it right a decade ago!
In article <E4idnTel9NEZwdncRVn-tw@speakeasy.net>,
Steven T. Hatton <susudata@setidava.kushan.aa> wrote: >I'm reading through the Inventor Mentor for SGI's Open Inventor (C++ OpenGL >binding). I just noticed they named their example file "Molecule.c++". >This choice is so obvious and rational to me that I felt it wasn't even >worth discussing. The only reason I haven't used the .c++ extention is >that no one else seems to use it, and my tools don't recognize it. But now >I see that SGI was doing it ten years ago. Why didn't this become the >"standard"? ".c" means a C source file to both me, and my tools. I've >noticed this is what Stroustrup uses on his website - much to my surprize. >".cpp" is quite common, and is used by both Trolltech and KDevelop. To me, >"cpp" means the C preprocessor, so that convention seems wrong. Koenig and >Moo use ".cc" which is the most agreeable convention I've seen in common >use. But ".c++" is superior to all of these! Comeau C++ accepts .c++ on some platforms. On others it does not, in some cases because the OS doesn't allow +'s in filenames, which is why Standard C++ is generally silent on file names (even header file names used need not literally be those names on your filesystem, or even be on a filesystem). -- Greg Comeau / Comeau C++ 4.3.3, for C++03 core language support Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried it? |
Re: SGI had it right a decade ago!
"Steven T. Hatton" <susudata@setidava.kushan.aa> wrote in message news:E4idnTel9NEZwdncRVn-tw@speakeasy.net... > I'm reading through the Inventor Mentor for SGI's Open Inventor (C++ > OpenGL > binding). I just noticed they named their example file "Molecule.c++". > This choice is so obvious and rational to me that I felt it wasn't even > worth discussing. The only reason I haven't used the .c++ extention is > that no one else seems to use it, and my tools don't recognize it. But > now > I see that SGI was doing it ten years ago. Why didn't this become the > "standard"? ".c" means a C source file to both me, and my tools. I've > noticed this is what Stroustrup uses on his website - much to my surprize. > ".cpp" is quite common, and is used by both Trolltech and KDevelop. To > me, > "cpp" means the C preprocessor, so that convention seems wrong. Koenig > and > Moo use ".cc" which is the most agreeable convention I've seen in common > use. But ".c++" is superior to all of these! I use ".txt" as my normal C++ source file extension. What I just said was a lie (I don't), but it would work, and the point I'm trying to make is that it really doesn't matter as long as you can others can identify what the file is for. James |
Re: SGI had it right a decade ago!
"Steven T. Hatton" <susudata@setidava.kushan.aa> wrote in message news:E4idnTel9NEZwdncRVn-tw@speakeasy.net... > I'm reading through the Inventor Mentor for SGI's Open Inventor (C++ OpenGL > binding). I just noticed they named their example file "Molecule.c++". > This choice is so obvious and rational to me that I felt it wasn't even > worth discussing. The only reason I haven't used the .c++ extention is > that no one else seems to use it, and my tools don't recognize it. But now I would bet they are configurable, at least I do know MSVC is for recognizing ".cxx" and ".ipp". Although the '++' may screw up some command line parsers. > I see that SGI was doing it ten years ago. Why didn't this become the > "standard"? ".c" means a C source file to both me, and my tools. I've > noticed this is what Stroustrup uses on his website - much to my surprize. > ".cpp" is quite common, and is used by both Trolltech and KDevelop. To me, > "cpp" means the C preprocessor, so that convention seems wrong. Koenig and I think there are drugs to help control these obsessive/compulsive tendencies. ;^) Jeff F |
Re: SGI had it right a decade ago!
"Steven T. Hatton" <susudata@setidava.kushan.aa> wrote in message: > "cpp" means the C preprocessor, so that convention seems wrong. Koenig and > Moo use ".cc" which is the most agreeable convention I've seen in common > use. But ".c++" is superior to all of these! I've found that whatever system is used for the free web space provided by my ISP doesn't allow ++ in file names. This has already caused me no end of trouble, even though only a single file is involved: 'c++boost.gif'. So I hope the convention doesn't change any time soon ;-) Jonathan |
Re: SGI had it right a decade ago!
"Steven T. Hatton" <susudata@setidava.kushan.aa> wrote in message news:E4idnTel9NEZwdncRVn-tw@speakeasy.net... > I'm reading through the Inventor Mentor for SGI's Open Inventor (C++ OpenGL > binding). I just noticed they named their example file "Molecule.c++". > This choice is so obvious and rational to me that I felt it wasn't even > worth discussing. The only reason I haven't used the .c++ extention is > that no one else seems to use it, and my tools don't recognize it. But now > I see that SGI was doing it ten years ago. Why didn't this become the > "standard"? ".c" means a C source file to both me, and my tools. I've > noticed this is what Stroustrup uses on his website - much to my surprize. > ".cpp" is quite common, and is used by both Trolltech and KDevelop. To me, > "cpp" means the C preprocessor, so that convention seems wrong. Koenig and > Moo use ".cc" which is the most agreeable convention I've seen in common > use. But ".c++" is superior to all of these! What difference does it make? There is no requirement made in the standard for any extension. Use whatever you want and works well for you. I'll use whatever I want and works well for me. (Are you sure that ".c++" is even valid on all platforms?) -Howard |
| All times are GMT. The time now is 04:34 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.