Actually I believe we both agree on the same point! Although I just took in the human factor of him being a professional C programmer to figure that he would achieve both optimal performance and development time with the language he is used to.
Core language wise of course you could compare something like the templated introsort of std::sort and the C library qsort and the C++ will kill it performance-wise as due to templating it will be typed as well as not need an indirection and there are many places this could be pointed out... although if someone really had a performance concern in C they wouldn't be using qsort (so as you mentioned the human factor). And as Spiro mentioned people may point out virtuals as performance issues due to the cache miss but if a virtual is truly warranted it likely would have been coded the same way in C anyways (by building a vtable of function pointers).
My bad for reading your post incorrectly, I had assumed you meant that you would see a raw performance benefit just by using C++ or C# over straight C but that was not the case.
Show differencesHistory of post edits
#1Saruman
Posted 19 October 2012 - 02:06 PM
Actually I believe we both agree on the same point! Although I just took in the human factor of him being a professional C programmer to figure that he would achieve both optimal performance and development time with the language he is used to.
Core language wise of course you could compare something like the templated introsort of std::sort and the C library qsort and the C++ will kill it performance-wise as due to templating it will be typed as well as not need an indirection and there are many places this could be pointed out... although if someone really had a performance concern in C they wouldn't be using qsort (so as you mentioned the human factor). And as Spiro mentioned people may point out virtuals as performance issues due to the cache miss but if a virtual is truly warranted it likely would have been coded the same way in C anyways.
My bad for reading your post incorrectly, I had assumed you meant that you would see a raw performance benefit just by using C++ or C# over straight C but that was not the case.
Core language wise of course you could compare something like the templated introsort of std::sort and the C library qsort and the C++ will kill it performance-wise as due to templating it will be typed as well as not need an indirection and there are many places this could be pointed out... although if someone really had a performance concern in C they wouldn't be using qsort (so as you mentioned the human factor). And as Spiro mentioned people may point out virtuals as performance issues due to the cache miss but if a virtual is truly warranted it likely would have been coded the same way in C anyways.
My bad for reading your post incorrectly, I had assumed you meant that you would see a raw performance benefit just by using C++ or C# over straight C but that was not the case.