On Tue, 16 Sep 2003 08:58:24 +0100, Dr Russel Winder wrote:
>On Tue, 2003-09-16 at 02:23, Allen Milewski wrote:
>...
>Graham Roberts (UCL) and myself have found that the teaching strategy
>makes a very big difference to the ability to learn OO. If you teach
>procedural first (particularly if it is done in a completely
>constructivist, i.e. bottom-up, way) then OO is hard. If you teach OO
>from the outset being open that there are things not explained (but
>giving forward references for those who want to find out) then OO is a
>lot, lot easier.
I agree with Dr. Winder -- the strategy used for teaching OO
makes a huge difference. After a failed attempt to teach Java
to beginning programmers, I formulated the following guidelines
for my own work (published as a letter to the editor in CACM,
Feb. 2002, p. 11):
Guidelines for early examples used to teach OO:
1. Objects should be explicitly instantiated (thus excluding
using strings and System.out as "objects"). Understanding
how objects are created is a vital part of learning to think
with objects.
2. Objects should have their methods invoked, otherwise students
view them simply as data containers or abstract pieces of
syntax.
3. Each object should have easily discernable state and behavior.
If not, the two core aspects of an object will remain a
mystery to students.
4. Examples should contain two or more instances of the same
class to drive home that each object has its own state but
shares behavior with other members of its class.
5. Static methods, other than main, should be avoided because
they don't affect the state or behavior of individual objects,
thus clouding two core concepts.
6. Students should not need to master both using objects and
writing classes at the same time.
For the last 5 years we (School of Computer Science, University
of Waterloo) have been using an approach based on Karel the Robot
with great success. Students are given a suite of objects they
can use to learn what objects are and how to use them. We then
extend the existing classes to introduce inheritance, developing
methods, stepwise refinement, and algorithms. The visual nature
of Karel the Robot provides a wonderful context for teaching
control structures -- all in a very object-oriented fashion.
The course continues, of course, with arrays, I/O, polymorphism,
and an intro to GUIs. (This is an aggressive version of the
course for students with a programming background, but not OO.
We do the same material, stretched over two terms, for students
with no programming background.)
Our course web site is at
http://www.student.cs.uwaterloo.ca/~cs133/
and info about a book I'm writing that is being used in
the course is at http://www.cs.uwaterloo.ca/~bwbecker/robots/
Byron
=========================================================================
Byron Weber Becker [EMAIL PROTECTED]
Department of Computer Science http://www.math.uwaterloo.ca/~bwbecker/
University of Waterloo (519) 888-4567 x4661
Waterloo, Ontario N2L 3G1 fax: (519) 885-1208
----------------------------------------------------------------------
PPIG Discuss List ([EMAIL PROTECTED])
Discuss admin: http://limitlessmail.net/mailman/listinfo/discuss
Announce admin: http://limitlessmail.net/mailman/listinfo/announce
PPIG Discuss archive: http://www.mail-archive.com/discuss%40ppig.org/