[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c code vs c++ code



Mark Collins wrote:

>On Sunday 24 November 2002 11:01 am, you wrote:
>
>>Since there is a standard for C++, I would think that it is probably
>>because the programmer is more familiar with C and is used to using it.
>>I know that C code is normally faster than C++ code, but I wouldn't
>>think that file handling would be something that needed to be highly
>>optimized for speed.
>>
>
>Anyone who says the "C is faster than C++" is either ignorant or a liar, and 
>the same applies if they say "C++ is faster than C". The same logic would 
>apply to someone saying "It's faster to read a dead-tree book than it is to 
>read an online-book".
>
C is certainly not a faster language than C++. However C++ makes it easier
to make performance bottlenecks that are hard to track down. Careless use of
virtual functions in criticial loop is one example. Misuse of templates 
so you get
lots of code bloat is another one.


Greetings,

-- 
==============================================================================
Jorrit.Tyberghein@uz.kuleuven.ac.be, University Hospitals KU Leuven BELGIUM

"In a word -- im-possible!"
"That's two words," said Dibbler.
        -- (Terry Pratchett, Moving Pictures)
==============================================================================