Sometimes it is appropriate to trade
execution speed for programmer productivity. A financial model, for example, may
be useful for only a short period of time, so it’s more important to
create the model rapidly than to execute it rapidly. However, most applications
require some degree of efficiency, so C++ always errs on the side of greater
efficiency. Because C programmers
tend to be very efficiency-conscious, this is also a way to ensure that they
won’t be able to argue that the language is too fat and slow. A number of
features in C++ are intended to allow you to tune for performance when the
generated code isn’t efficient enough.
Not only do you have the same low-level
control as in C (and the ability to directly write assembly language within a
C++ program), but anecdotal evidence suggests that the program speed for an
object-oriented C++ program tends to be within ±10% of a program written in
C, and often much
closer[22].
The design produced for an OOP program may actually be more efficient than the C
counterpart.