Linked by anonymous on Tue 29th Mar 2011 16:05 UTC
General Development The C++ programming language is about to be updated, as the ISO steering committee for the language has approved the final draft specifying its next version. The ISO/IEC Information Technology Task Force will review the steering committee's Final Draft International Standard will review and, barring any complications, publish the draft later this year. It will be known as C++ 2011.
Thread beginning with comment 468361
To view parent comment, click here.
To read all comments associated with this story, please click here.
rom508
Member since:
2007-04-20

Sorry I made a mistake, it was some time ago when I did the tests and I don't have the sources. It wasn't 200K I got confused, I think the size difference was something like 2K.

Your test program is a bit simplistic, you need to call functions to insert items into list, then traverse the list, deleting every item. This is more or less what real code does.

So 2K is not a huge size, but it's still much more than similar implementation in C. In a large program bloat from STL can add up pretty quickly.

Reply Parent Score: 1

MORB Member since:
2005-07-06

Sorry I made a mistake, it was some time ago when I did the tests and I don't have the sources. It wasn't 200K I got confused, I think the size difference was something like 2K.

Your test program is a bit simplistic, you need to call functions to insert items into list, then traverse the list, deleting every item. This is more or less what real code does.

I implemented the test program that you suggested, and mainly with the goal to dispel that bogus 200k claim. Making a more complicated test program would only allow a meaningful comparison if compared to a program doing the same thing in pure C.

So 2K is not a huge size, but it's still much more than similar implementation in C.

If you keep comparing a concrete C++ example with some undefined "similar implementation in C", then yes, the concrete implementation is going to lose the comparison to the imaginary implementation every time.

There are many parameters. Would the C version be implemented as inline code or separate functions? Would it use a custom allocator or not? Are we talking about a thread-safe implementation or not?

In a large program bloat from STL can add up pretty quickly.

You have yet to make a compelling case that it is "bloat" and not "stuff one have to implement themselves if not using the STL". And "pretty quickly" compared to what? How do you define "pretty quickly" in this context anyway?

Reply Parent Score: 3

boldingd Member since:
2009-02-19

I would also note that it's probably going to take a lot longer to write the "equivalent C program." C doesn't have abstract containers: you get to write the linked-list implementation yourself, and you get to wade into lots of explicit memory management while you do it. The more complicated your use of those containers, the wider the difference in developer time cost is going to get.

The realization that made C++ so popular, and has made Java, C# and Python so popular after it, is that in many applications -- particularly, desktop applications -- greater developer productivity is significantly more valuable than the performance efficiency of the resulting implementation.

Reply Parent Score: 3