Concepts of Programming Languages

(Sean Pound) #1

88 Chapter 2 Evolution of the Major Programming Languages


2.16 Combining Imperative and Object-Oriented Features: C++................


The origins of C were discussed in Section 2.12; the origins of Simula 67 were
discussed in Section 2.10; the origins of Smalltalk were discussed in Section
2.15. C++ builds language facilities, borrowed from Simula 67, on top of C to
support much of what Smalltalk pioneered. C++ has evolved from C through
a sequence of modifications to improve its imperative features and to add con-
structs to support object-oriented programming.

2.16.1 Design Process


The first step from C toward C++ was made by Bjarne Stroustrup at Bell
Laboratories in 1980. The initial modifications to C included the addition
of function parameter type checking and conversion and, more significantly,
classes, which are related to those of SIMULA 67 and Smalltalk. Also included
were derived classes, public/private access control of inherited components,
constructor and destructor methods, and friend classes. During 1981, inline
functions, default parameters, and overloading of the assignment operator were
added. The resulting language was called C with Classes and is described in
Stroustrup (1983).
It is useful to consider some goals of C with Classes. The primary goal
was to provide a language in which programs could be organized as they could
be organized in SIMULA 67—that is, with classes and inheritance. A second
important goal was that there should be little or no performance penalty rela-
tive to C. For example, array index range checking was not even considered
because a significant performance disadvantage, relative to C, would result. A
third goal of C with Classes was that it could be used for every application for
which C could be used, so virtually none of the features of C would be removed,
not even those considered to be unsafe.
By 1984, this language was extended by the inclusion of virtual methods,
which provide dynamic binding of method calls to specific method definitions,
method name and operator overloading, and reference types. This version of
the language was called C++. It is described in Stroustrup (1984).
In 1985, the first available implementation appeared: a system named
Cfront, which translated C++ programs into C programs. This version of
Cfront and the version of C++ it implemented were named Release 1.0. It is
described in Stroustrup (1986).
Between 1985 and 1989, C++ continued to evolve, based largely on user
reactions to the first distributed implementation. This next version was named
Release 2.0. Its Cfront implementation was released in June 1989. The most
important features added to C++ Release 2.0 were support for multiple inheri-
tance (classes with more than one parent class) and abstract classes, along with
some other enhancements. Abstract classes are described in Chapter 12.
Release 3.0 of C++ evolved between 1989 and 1990. It added templates,
which provide parameterized types, and exception handling. The current ver-
sion of C++, which was standardized in 1998, is described in ISO (1998).
Free download pdf