SGI had it right a decade ago!

S

Steven T. Hatton

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!
 
G

Greg Comeau

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

Aguilar, James

Steven T. Hatton said:
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
 
J

Jeff Flinn

Steven T. Hatton said:
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
 
J

Jonathan Turkanis

Steven T. Hatton said:
"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
 
H

Howard

Steven T. Hatton said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top