Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Why C++ sucks: Not Flame Bait

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
Why C++ sucks: Not Flame Bait
Neil Black
Member #7,867
October 2006
avatar

Quote:

Arguing on the Internet is like running in the Special Olympics, even if you win you're still retarded

Someone please sig that.

Kibiz0r
Member #6,203
September 2005
avatar

Allegro.cc: Harvesting decade-old internet content since [whatever date]

Neil Black
Member #7,867
October 2006
avatar

Well, what else am I supposed to do at 2a.m.? Sleep? I don't have to get up until 11, I can stay up for two more hours if I feel like it.

axilmar
Member #1,204
April 2001

Quote:

Game tools is a tiny subgroup of Applications.
I'd even dare say that "applications that need 3d graphics" are a tiny subgroup of "applications".

You'll be surprised how many applications can benefit from 3d graphics support. Not only that, but you can do really rich (graphically) applications by using the 3d graphics capabilities of modern video cards. If you have seen any JavaFX or Silverlight demo, or webOS demos (youos, ajaxwindows etc) you can see how horribly slow these apps are graphics-wise.

Slartibartfast
Member #8,789
June 2007
avatar

axilmar
Member #1,204
April 2001

Quote:

Hardware acceleration != 3d graphics support

Well, in most systems they go hand in hand. And giving depth to 2d graphics is quite important (that's why OS X and Vista's GUI have some 3d effects.

ThePredator
Member #8,646
May 2007

I use Ada, it makes C look like it's out of the Bronze Age, and C++ look like a pile of misimplemented features.

Yodhe23
Member #8,726
June 2007

So am I right that thinking generally that C produces programmes that
execute and compile faster..

(Obviously it always come down to the code written, but as a general principle).

www.justanotherturn.com

Tobias Dammers
Member #2,604
August 2002
avatar

Quote:

So am I right that thinking generally that C produces programmes that
execute and compile faster..

No.

C++ does have a lot of (optional, mind you) features that take more time to compile; especially templates are notorious for this. The upside, though, is that these features can make for easier and faster development, if used well.

As for execution times: Since both C and C++ compile to machine code, the only reason for performance differences would be the compiler, not the language. C++ doesn't sacrifice run-time performance for anything (which is one of the main reasons why C++ offers so many opportunities for abuse), and a "clean" C program (that is, one that is both valid C and C++) compiled through c and through c++, both with proper optimization, should produce equivalent results.

Of course, virtual functions slow things down, but so do vtables programmed in C. The only difference is that C++ hides the whole messy vtable code from you and makes it "pretty", so people use it a lot more.

Then; a language is a language, and libraries are libraries. You cannot judge a language based on its libraries; even with the best of libraries, Malbolge will still be Malbolge. On the contrary; one of the main reasons I dislike Java is that it comes with such a horrendous bloat of packages I don't need, but still have to download, install, and sit around on my hdd just in case someone might need them. Sure, opninions on what to include in the language standard and what differ; Java takes it to one extreme, C to the other.

Finally; I don't think the "being similar to C" part is what makes C++ bad. There are other languages that are "similar to C": Java, PHP, Javascript, C#, D, to name a few, that don't have the same issues (though they may have others). Personally, learning C++ has made me explore a wide range of programming techniques and a good understanding of what goes on behind the scenes; this makes it easy for me to pick up other languages.

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

axilmar
Member #1,204
April 2001

Quote:

I use Ada, it makes C look like it's out of the Bronze Age, and C++ look like a pile of misimplemented features.

You do? Ada is designed by the US DoD, and implements most of the SteelMan standard (a standard from 1978!). All the other languages implement less % of that standard than Ada.

Here is the relevant link:

Ada, C, C++, and Java vs. The Steelman

Now if C++ seems bloated, what one can say about Ada!!! the fact is C++ is not very bloated, but it indeed looks like a pile of randomly chosen features.

EDIT:

Here is another C++ "gotcha": everywhere on the internet you can find that in C++, the order destructors are called is the reverse order constructors are called.

But in reality, it is not like that :(. For example:

A func() {
    A a;
    return a;
}

B b = func();

In the above code, the order of construction is:

  1. A()

  2. B()

And the order of destruction is:

  1. ~A()

  2. ~B()

So if you do any kind of code which assumes the order of destruction is the reverse order of construction, the code will simply not work.

Isn't C++ a very nice language? :-)

 1   2   3 


Go to: