[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: c code vs c++ code
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".
The difference in performance is down to the compiler, and the skill of the
programmer (as well as, like others mentioned, the kernel and any external
libraries used).
Any bottlenecks that would be introduced using C++ [0] would be in memory
management and in calling functions, which, to be completely honest, is an
easy bottleneck to fix by moving any performance critical code into less
congested areas and cleaning things up.
Nurgle
[0] Assuming the compiler is shit