Yea right. This guy is full of it. This article is very biased...
Why C++ is vastly superior to C
31–40 of 123 posts
Re: Why C++ is vastly superior to C
#32It's just too goddamn easy to make a mess in C++ without noticing it. In C, if you make a mess, you will more likely notice it before it's unmanageable.
Re: Why C++ is vastly superior to C
#33The containers problem is the only one I find really annoying, and is more of a problem with the C standard library than the language. Using C with something like glib is a much nicer experience.
Re: Why C++ is vastly superior to C
#34There's a great post by Linus Torvalds about C vs. C++ in the kernel. Some excerpts:
"My point being, that C++ adds absolutely nothing interesting."
"C++ is a mess. There's no design. It's just "add crud on top of C". And the crud isn't even meaningful, much less does it have a design. It's totally and utterly random.
It started out random, now it's randomness that gets added to by a committee."
Whole thing: http://www.realworldtech.com/forums/index.cfm?action=detail&...
Re: Why C++ is vastly superior to C
#35The "final straw" is easily overcome with unions. Also I do not buy the argument that you do not have to follow coding conventions in C++ or that explicitly freeing memory is a bad thing. Also comparing the number of lines of code to determine the "best" language is childish. By that logic the language with the largest std. lib is the best.
If I were to defend C, I'd rather choose macros combined with plain typeless buffers. The choice between C and C++ in such cases is really a choice between the nightmare of wrong memory operations and total type unsafety on the one hand (C), and the nightmare of ineffective, bloated code on the other (C++). I believe the latter can be taken under control though.
Re: Why C++ is vastly superior to C
#36Re: Why C++ is vastly superior to C
#37The containers problem is the only one I find really annoying, and is more of a problem with the C standard library than the language. Using C with something like glib is a much nicer experience.
If you can't write your own linked lists or hash tables, you should not be programming in C. Glib is an abomination by people and for people that didn't understand C. Just like GNU is by people and for people that didn't understand UNIX.
Re: Why C++ is vastly superior to C
#38This post boils down to "Take C, add support for OO, a crapload of new syntax, standard library that 10x as large and ta-da! you can find problems which have simpler solutions than in C." There's a great post by Linus Torvalds about C vs. C++ in the kernel. Some excerpts: "My point being, that C++ adds absolutely nothing interesting." "C++ is a mess. There's no design. It's just "add crud on top of C". And the crud i…
http://warp.povusers.org/OpenLetters/ResponseToTorvalds.html
Re: Why C++ is vastly superior to C
#39When the argument is that C++ has too many features that interact in unpredictable ways and are virtually impossible to get right, arguing that C++ is superior because it has more features is perhaps a fine argument in some hypothetical universe in which the primary objection to C++ is that it is missing features, but by failing to grapple with the points raised by the opposition in the real universe, you will fail t…
What are some of these C++ features that interact in unpredictable ways? Just curious.
Consider this program:
#include
using std::cout;
using std::endl;
struct C {
int x;
C(int _x) : x(_x) {}
operator bool() const { return 0 != x; }
};
struct D {
float f;
D(float _f) : f(_f) {}
operator bool() const { return 0.0f != f; }
};
int main() {
C c(9);
D d(2.0f);
if (c == d) {
cout
g++ 3.4.4 doesn't so much as warn that something is fishy here, even with -Wall.Not only that, but c and d are considered to be equal.
Re: Why C++ is vastly superior to C
#40I know that C++ has some pretty neat features, but I feel comfortable and productive enough in C. I have never really felt that there was anything in C++ that I just had to have. If I need to something higher level there are plenty of choices of that already, and C is a great language for extending applications done in a higher level language. I think that the author has some good points. but I think both languages h…
> If C++ was really "vastly superior" to C then why are so many people still using C and using it productively? Why are so many people using Java (perhaps even more than C and C++ combined)? Does it make a good language? Absolutely not. In the case of such simplistic languages as C and Java, it's their simplicity that makes them a popular choice. Productivity: I am not sure all the C folks are as productive as they c…
Well, one contributing factor is that a lot of universities now have a heavily Java based curriculum (turning their CS programs into vocational schools, but I digress).
Another contributing factor is that Java has managed to carve itself a niche in which it is used extensively ("enterprise" applications - with all of the wonderful ambiguity that the word "enterprise" carries nowadays).
One more thing in Java's favor is just simple momentum. There are a lot of Java libraries that just plain work (and some work extremely well). There are a lot of applications on the corporate side that use Java.
Regardless of whether you or I like the language or not, Java has apparently proven itself useful to a broad swathe of people. It may not be an exciting language, but then neither is Cobol and it still exists as well (and puts food on quite a few tables).
Then there is the venerable JVM, which is actually an amazing piece of software engineering that has enabled the development of a wave of innovative new languages. Of course, one of the features of many of these new languages is the ability to drop down into Java for speed (now before anyone starts sneering, Java is actually not doing to bad on that front right now).
"Does it make a good language? Absolutely not."
Perhaps not in your opinion, but their are others who are quite fond of it. That's the problem with these type of pronouncements. What makes a "good language" varies from person to person.
Disclaimer: I have used Java for some small projects in the past - I may be somewhat biased.
Edit: Embarrassing grammatical flaws.