[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] c++ & mem
>>>>> "Al" == Alex Hudson <home [at] alexhudson.com> writes:
>> Actually, as C++ is defined as a superset of C, both of those
>> programs _are_ C++. It's just that one of them is also C ;)
Al> Crikey! That means practically everything in Linux is written
Al> in C++! And they say free software developers shun the
Al> language.....
Al> Hmmm ;) I don't think that's what most people refer to as
Al> "C++" ;)) The "language" refers to more than just the
Al> definition, I would include the ABI, the STL, and everything
Al> else which makes C++ C++. While (most) C will compile with a
Al> C++ compiler, esp. with extern "C" {, I can also do things
Al> like
#define BEGIN {
#define END }
Al> . and start compiling Ada with g++ too. At some point, the
Al> definition becomes stretched ;)
I see your point, but I think you're missing the big point in the
thread. Since C++ is a superset of C, blocks of code in C style can
be used where (a) efficiency is extremely important or (b) it's
convenient for some reason.
The original poster happened to want to test whether he could get a
working program built with g++; a C-style hello world program is
perfectly appropriate for that. The only problem is that language
bigots will take you to ask for using stdout instead of cout. This is
a very unusual application in that the whole program was written
C-style. Normally most of the program would use C++ facilities a lot.
Agreed, if you're going to use a C++ compiler, you should take
advantage of it to write more robust, readable programs. OTOH, I
should note that several of my codevelopers on XEmacs build XEmacs
with one or more C++ compilers by default, simply to enforce certain
coding conventions that apply to both C and C++.
--
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences Tel/fax: +81 (298) 53-5091
_________________ _________________ _________________ _________________
What are those straight lines for? "XEmacs rules."
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.