C++ OOP Tutorials?

Rob Wehrli plug-devel@lists.PLUG.phoenix.az.us
Sun Jul 15 08:25:01 2001


Carl Parrish wrote:
> 
> How about this one.
> http://www.ibiblio.org/obp/thinkCScpp/
> 
> Rob Wehrli wrote:
> 
> >Kit Plummer wrote:
> >
> >>Can anybody point me to some good Object-Orient tutorials for C++?
> >>
> >

Carl,

Not to be overly critical, but there really isn't any OOP in the link
you provided.  It is more of an attempt at a "C++ Mechanics Guide"
rather than an OO piece using C++.  I'd be a bit concerned about the
value of an "OO" tutorial that didn't discuss polymorphism, inheritance
and encapsulation along with abstraction, which the CS link above has
this to say (generally) about abstraction:

//---BEGIN---//

But if the program guarantees that the current value of a variable is
never read before it is written, then the current value is irrelevant.
Abstractly, it makes sense to think of such a variable as "empty."

This kind of thinking, in which a program comes to take on meaning
beyond what is literally encoded, is a very important part of thinking
like a computer scientist.

Sometimes, the word "abstract" gets used so often and in so many
contexts that it is hard to interpret. Nevertheless, abstraction is a
central idea in computer science (as well as many other fields).

A more general definition of "abstraction" is "The process of modeling a
complex system with a simplified description in order to suppress
unnecessary details while capturing relevant behavior."

//----END----//

The implied reason *why* abstraction is a good thing, as noted above, is
in hiding details of the implementation, but this discussion, from the
mechanics of C++ is volumes, not one-liners.  I'd recommend the tutorial
above only for those interested in the simplest mechanics of the
langauge, especially since a large part of the content isn't C++, but
simple C...EG: toupper() tolower() etc.  The use of pstring in the text
is generally a good thing, but it tends to appear self-serving in that
if you don't have it, what use is it?  pstring is not included in the
Linux distributions with which I have familiarity.  

Additionally, the use of "iteration" to describe "looping" is probably a
bit out of context in a C++ discussion.  When I think "iteration" I
think of "iterators" in C++.  There is, naturally, a world of difference
between an "iteration" and an "iterator," which should be at least
briefly disclosed in a C++ tutorial attempting any more than the sheer
basics.

However, for someone just getting started with C++, the tutorial is a
not a terribly bad, basic introduction to the language mechanics.  But,
I'd recommend something else for that purpose.  Any introductory
discussion on "operators" that includes "detail" on operator precedence
(his and other commonly used, but "incorrect" terms for this is "order
of operations") doesn't even include bitwise and ternary operators...at
least not in the discussion of "operators."  Rather, sprinkled
throughout the text you'll eventually find operators of various types
placed in assumed context-oriented discussions.

Generally speaking, I'd have to pass on this tutorial as having enough
merit to warrant recommending it to others in any category of skill
level.  From the title of thinking like a computer scientist, I'd say
that it was written from the perspective of someone still trying to
learn how to think like one :)  The best thing about the "tutorial" is
that is is presented nicely, even if the organization is a bit
questionable.

Take Care.

Rob!