Is C++ Object Oriented?

Jim Kempf kempf at hplabsc.UUCP
Wed Jan 8 04:03:01 AEST 1986


The phrase "object oriented" has been used to describe C++. 
While the semantics of defining "object oriented" can get
tricky, I wonder if this term should be used to describe C++. A
crucial difference which I see between C++ and more unambiguously
object oriented languages, like Objective C, Smalltalk, and
Lisp Flavors, is that the unit of encapsulation in C++ is the
*class* rather than the individual member of that class. 
Member functions can access the "instance variables" (or
private parts, as they are called in C++) of any member of
the class. This has important implications for encapsulation
and data security.

In general, I find this aspect of C++ places it into the category
of "abstract type"/"module" languages, like Modula-2 and CLU
rather than "object-oriented" languages, like Smalltalk and
Lisp Flavors. While there are pros and cons to both approaches,
there is probably something to be said for making the distinction
clear. For example, no one would call Lisp an "Algol-like" language,
nor C a "symbolic processing language", even though it's possible to
do Algol-like things in Lisp (Common Lisp even has a notion of
block structuring) and symbolic processing in C.

		Jim Kempf		kempf at hplabs



More information about the Comp.lang.c mailing list