On (04 Apr 97) Frank Masingill wrote to All...
FM> I had made a New Year's Resolution to teach myself C++ this year.
FM> Then, here in April, I am re-reading Nammir Clement Shammas, _Moving
FM> From Turbo Pascal to C++_ and here's what I find on page 365 as the
FM> opening paragraph of his Chapter 13:
FM> "C++ extends the C Language by adding object-oriented programming
FM> language features. OOP purists, however, do not regard C++ as a true
FM> object-oriented programming language. This view is shared by the
FM> designers of C++. Nevertheless, C++ has enough OOP extensions to meke
FM> it quite useful in modeling objects...."
FM> He also says in his preface to the book that he just enjoys doing
FM> things in other languages.
FM> He stops short of saying that Turbo Pascal is a TRUE
FM> object-oriented programming language but I gather that is implied.
Two points here. First of all, his comment is just plain wrong.
Second, if we change his comment to one that's correct,it applies just
as much to Turbo Pascal as to C++.
C++ definitely IS a "true" OO language. Any language that supports
types with private data, derivation from those types, and polymorphism
over those types is TRULY object oriented.
What C++ (like Turbo Pascal) is NOT is a "pure" OO language.
C++ has built-in types that are not classes. In a pure OO language
(E.g. Smalltalk) ALL types are classes, including those that are built
into the language. For instance, in Smalltalk you can do the equivalent
of:
class myInteger : public int { };
but in C++ you can't derive from int, only from another class.
Of course in Turbo Pascal the syntax is a bit different, but the same
basic rule applies.
Likewise, in either C++ or Turbo Pascal, you can write a function (or
procedure) that isn't part of a class.
By contrast in a pure OO language like Smalltalk, any code you write has
to be part of a class. There's no such thing as a standalone function.
Many pure OO languages also require that all classes you create be
derived from some class that's built in. In fact, it's difficult to
create a pure OO system that works any other way. However, AFAIK, this
has never been postulated as being a real requirement of a pure OO
system; it's merely an extremely common side-effect.
Summary: C++ and recent versions of Turbo Pascal are both _truly_ object
oriented languages, but neither is a _purely_ object oriented language.
Later,
Jerry.
... The Universe is a figment of its own imagination.
--- PPoint 1.90
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)
|