The reader may mentally replace my use of the word "freaking" with other choice terms at his or her discretion.
The reader may mentally replace my use of the word "freaking" with other choice terms at his or her discretion.
ACK. I know many languages, and my advice after using C++ for several years is: Don't dare try to do everything in C++. Use C++ only when it is absolutely necessary.
Just compare this C++ code
http://shootout.alioth.debian.org/u32/program.php?test=regex...
with this equivalent Javascript code to understand immediately what I mean:
http://shootout.alioth.debian.org/u32/benchmark.php?test=reg...
It's funny that this V8 code runs even 4.5 times faster (!) than C++ :)
http://shootout.alioth.debian.org/u32/performance.php?test=r...
Non-zero, I'm sure, but I bet single-digit percentages, tops. Except that last one, which I'd put money on sub-1%.
What are the odds that C++, as a fairly extreme outlier, is actually closer to optimal for the general purpose tasks it is used for than all the other languages?
I don't like or use Java, and it isn't perfect by any means. My point is just how far I didn't have to go down the list of "mainstream languages" before your claim is completely false. C++ is an outlier.
C also has the memory leaking issue, but the rest is false as well. Though in the memory model case it's by virtue of not having one.
And that's sticking with a very generous-for-you interpretation of "mainstream". If I'm allowed to dip down to Python or something you're even worse off.
Naturally, that minimalism brings its own set of issues and complaints. But the point is, you don't need to be as much of a ball of mud as C++ in order to be useful or successful. I think a lot of language partisans, and C++ partisans in particular, point to Stroustrup's quote as an excuse for their language's warts. It's true that no language can ever be perfect, but that doesn't mean that all complaints are without merit and unworthy of attention and consideration.