[ fromfile: cppintro.xml id: overview ]
C++ was originally written as a series of preprocessor macros, an extension to C, known as C with Classes. After many years of evolution and refinement, it now extends C by adding several higher level features such as strong typing, data abstraction, references, operator and function overloading, and considerable support for object-oriented programming.
C++ retains the key features that have made C such a popular and successful language: speed, efficiency, and a wide range of expressiveness that allows programming at many levels, from the lowest - such as direct operating system calls or bitwise operations - to the the highest level, manipulating large complex objects and graphs of objects.
A fundamental design decision was made at the beginning for C++: Any features added to C++ should not cause a runtime penalty on C code that does not use them. [1] There are many advanced features in C++ that enable the programmer to write readable, reusable, object oriented programs and using those features invariably causes the compiler to do lots of extra work. But long compile times is a small price to pay for the power and maintainability of the resulting code. Some features have a runtime cost if they are used, but a C program that is compiled by a C++ compiler should run just as fast as it would if compiled by a C compiler.
[1] Unfortunately, exception handling broke this rule and does cause a bit of overhead if enabled. This is why many libraries still do not use exceptions.
| Generated: $Date: 2009-09-08 12:15:32 -0400 (Tue, 08 Sep 2009) $ | © 2009 Alan Ezust and Paul Ezust. |