[comp.lang.misc] Teaching object-oriented paradigm t

johnson@uiucdcsp.UUCP (01/09/87)

The answer to the question of whether or not to teach o-o programming
to beginning students depends partly upon what you think o-o programming is.
Some people think that o-o programming is little more than abstract
data-types.  In this case, it should certainly be taught to beginning
programmers, and in many cases, it is.  On the other hand, I think that
one of the most important ideas in o-o programming is the use of standard
interfaces (protocols) for objects such that many classes support the
same interface and programs can operate on objects in any of those classes.
This kind of polymorphism is not supported very well by most
non-object-oriented progamming languages.  For example, to make these kinds
of objects in C you have to use structures or arrays of pointers to
functions, not the kind of thing you want to explain to a beginning
programmer.  Thus, teaching this kind of o-o programming requires an o-o
programming language.

Some schools teach a non-standard language for the first programming course,
but I think that the political realities force most schools to teach a
language that students might possibly use when they graduate.  While we might
wish that CS was considered more of real science and less of a service
discipline, the fact is that most people who want to take CS courses just
want to learn how to program so that they can solve some particular problem.
These students are not thrilled by learning a language that they can never
use again.  It doesn't matter that the skills that they learn are easily
transferred to other languages (which, by the way, is not always true,
especially for the less able students), that this language teaches them
better thought-habits than others, etc.  It has been a major struggle for
some schools to switch from Fortran to Pascal in the first programming
course, it would be even harder to switch to C++, Object Pascal, or
(shudder) Smalltalk.

Thus, if you can teach o-o programming in Pascal, fine.  You are really just
teaching students better design skills.  If you have to switch to a new
language, good luck!

For your information, I do most of my programming in Smalltalk and even
teach courses in it, but not to beginners.  I would be glad to teach
beginners Smalltalk, and at a place like Illinois I am sure I could find
a bunch who would be interested in learning.  However, they would still
be a small minority.

shebs@utah-cs.UUCP (Stanley Shebs) (01/12/87)

In article <82100001@uiucdcsp> johnson@uiucdcsp.cs.uiuc.edu writes:

>Some people think that o-o programming is little more than abstract
>data-types.  In this case, it should certainly be taught to beginning
>programmers, and in many cases, it is.  On the other hand, I think that
>one of the most important ideas in o-o programming is the use of standard
>interfaces (protocols) for objects such that many classes support the
>same interface and programs can operate on objects in any of those classes.

Hmmm, when I think "abstract data types" I just naturally assume that they
allow polymorphism.  Are there actually people that don't believe polymorphism
is a Good Thing? :-)

>Some schools teach a non-standard language for the first programming course,
>but I think that the political realities force most schools to teach a
>language that students might possibly use when they graduate.

Utah teaches at least three elementary courses, emphasizing Fortran, C,
and Pascal/Scheme, respectively.  The last-named is what CS pre-majors
start out in, and there is a healthy dose of concepts in the course.
On the other hand, the Pascal and Scheme mix is a bit schizophrenic...

							stan shebs