Linked by Amjith Ramanujam on Wed 20th Aug 2008 19:37 UTC
General Development DevX interviewed Bjarne Stroustrup about C++0x, the new C++ standard that is due in 2009. Bjarne Stroustrup has classified the new features into three categories Concurrency, Libraries and Language. The changes introduced in the Concurrency makes C++ more standardized and easy to use on multi-core processors. It is good to see that some of the commonly used libraries are becoming standard (eg: unordered_maps and regex).
Permalink for comment 327476
To read all comments associated with this story, please click here.
RE: what is C++ best for?
by jacquouille on Wed 20th Aug 2008 22:19 UTC in reply to "what is C++ best for?"
jacquouille
Member since:
2006-01-02

Just to give the one example where I have first-hand experience: mathematical software, such as vector/matrix libraries.

Here, one pursues two goals that are generally considered incompatible:

On the one hand, one wants to imitate math notation : "a = b+c*d" etc... this can be achieved with any object-oriented language through operator overloading and method chaining. The problem is that the passing of arguments and of return values, the evaluation of temporaries, etc, kill the performance.

On the other hand, one wants not only the best performance, but also optimal memory usage. For example, when you have a million of small vectors, you really want to make sure that each vector takes the minimum possible number of bytes. This rules out many object-oriented features, which are mandatory in many languages. For example, if your small vectors take only 8 bytes each, you definitely can't afford a vtable pointer which by itself takes 4 or 8 bytes!

This was just one example where C++ shines.

More generally, the full control that you get over the generated code, the template meta-programming (btw the C++0x spec is obviously reflecting the increasing importance of that paradigm), the "you only pay for what you use" design, make it a killer language for performance. For math software, it allows optimal performance (like C) with 5% the lines of code (I'm not making this up -- comparing the library i'm co-developing with existing C libraries. See http://eigen.tuxfamily.org/index.php?title=Benchmark)

Edited 2008-08-20 22:24 UTC

Reply Parent Bookmark Score: 9