473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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.

Jul 22 '05 #1
5 1098
In article <E4********************@speakeasy.net>,
Steven T. Hatton <su******@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?
Jul 22 '05 #2

"Steven T. Hatton" <su******@setidava.kushan.aa> wrote in message
news:E4********************@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
Jul 22 '05 #3

"Steven T. Hatton" <su******@setidava.kushan.aa> wrote in message
news:E4********************@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
Jul 22 '05 #4

"Steven T. Hatton" <su******@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
Jul 22 '05 #5

"Steven T. Hatton" <su******@setidava.kushan.aa> wrote in message
news:E4********************@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

Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Earl | last post by:
Any known fixes for the wacky right-alignment bug in the WinForms datagrid (VS2003)? I've tried Ken's workaround...
8
by: Derek Basch | last post by:
Given a value (x) that is within the range (1e-1, 1e7) how do I round (x) up to the closest exact logarithmic decade? For instance: 10**3 = 1000 x = 4978 10**4 = 10000 x = 10000 Thanks...
1
by: Kaz Kylheku | last post by:
1996: "Scott Nudds" "It should be clear however, that with a sufficiently complex preprocessor, it is entirely possible to exactly emulate any compiled language. Compilers are exactly this kind...
4
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't...
22
by: ashkaan57 | last post by:
Hi, I am trying to put text on left and right side of the page and used: <div> <span>blah blah</span> <span style="float:right">blah blah</span> </div> The 2nd text does go to the right but the...
6
by: JamesG | last post by:
I'm trying to convert a unix timestamp to a readable time, such as 4 hours ago, or 25 minutes ago. My code is below: function ago($ts) { /* time difference */ $ts = (time() - $ts); if($ts <...
13
by: Roderik | last post by:
Hi, I am wondering why (half of the) squared images are not aligned on the right of the text in Internet Explorer (using <img ... align="right" />. I thought this was supported even in IE. In FF...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.