I know I'll get flamed/modded down for this, but it needs to be said: there is no reason for new apps to be written in C. C++ can do everything that C can do, just as efficiently; it's easier to read, which means a code review is more effective; language features and the STL reduce the need for explicit dynamic memory allocation, which is a source of bugs in C; the language is a better match than C to modern, object-oriented methods of analysis and design; - I could go on, but shouldn't need to.
Unfortunatly g++ is not a good c++ compiler so all the Unix nerds look at the size of the compiled program and time to execute and assume the problem is with C++ itself and then continue to work in C.
There is alot of anti c++ sentiment in the unix community because of that.
Unfortunately, a problem with g++ is (for Linux developers) a problem with c++. There aren't many alternatives, so while g++ may not be a shining example of how c++ can be, it's a good example of how it is. It makes sense to consider the available compilers when deciding whether to use the language (and also partially when bashing the language - if it's impossible to write a good compiler for, it's likely to be hard to write code in - due to complexity).
Measure the execution time of a typical C++ program as compiled into an executable. It appears that Billly Gates and qbwiz claim that other vendors' proprietary C++ compilers have a much bigger speed gain over g++ than their C compilers have over gcc.
C++ suffers from all the memory bugs of C, because it allows all the same things. A good C++ programmer wont use those things, just like a good C programmer wont do stupid stuff in C.
But C++ is not inherently safer than C, it's just as dangerous as C and has the added bonus of being complicated, unweildy and inconsistent.
there is no reason for new apps to be written in C.
By "new apps" do you mean this to include "new versions of g++" as well? If so, then how would you recommend bootstrapping a C++ compiler on a system with only GCC?
language features and the STL reduce the need for explicit dynamic memory allocation
To a developer who has to fit algorithms and data structures into a handheld computer's 32 KB of fast RAM when all other RAM in the system has horrible wait state behavior, every byte still counts. I've
White dwarf seeks red giant for binary relationship.
Yet another library for an obsolete language (Score:1, Troll)
Re:Yet another library for an obsolete language (Score:5, Informative)
There is alot of anti c++ sentiment in the unix community because of that.
Re:Yet another library for an obsolete language (Score:1, Insightful)
http://tinyurl.com/605v
Re:Yet another library for an obsolete language (Score:3, Interesting)
Re:Yet another library for an obsolete language (Score:2)
However many programs like the Linux kernal are hard coded for gnu specific features.
But for general coding its inexpensive and quite good.
Re:Yet another library for an obsolete language (Score:2)
I disagree; I think the current version is a fine C++ compiler. What's wrong with it?
Re:Yet another library for an obsolete language (Score:1)
Measure the execution time of a typical C++ program as compiled into an executable. It appears that Billly Gates and qbwiz claim that other vendors' proprietary C++ compilers have a much bigger speed gain over g++ than their C compilers have over gcc.
Re:Yet another library for an obsolete language (Score:2)
MS VC++ is a good one and so is watcom C++ and Borland.
None are ported to Unix.
IF you look at the resulted assembly code you will see many many unoptimized code that MS VC++ and Borland would optimize by default.
Re:Yet another library for an obsolete language (Score:2, Interesting)
A good C++ programmer wont use those things, just like a good C programmer wont do stupid stuff in C.
But C++ is not inherently safer than C, it's just as dangerous as C and has the added bonus of being complicated, unweildy and inconsistent.
Where every byte counts (Score:1)
there is no reason for new apps to be written in C.
By "new apps" do you mean this to include "new versions of g++" as well? If so, then how would you recommend bootstrapping a C++ compiler on a system with only GCC?
language features and the STL reduce the need for explicit dynamic memory allocation
To a developer who has to fit algorithms and data structures into a handheld computer's 32 KB of fast RAM when all other RAM in the system has horrible wait state behavior, every byte still counts. I've