[Tutor] Re: Python information
alan.gauld@bt.com
alan.gauld@bt.com
Mon, 5 Aug 2002 11:48:09 +0100
> COBOL programmers? Never did get it. But that's another story. :-)
:-)
But they're all using COBOL PLUS OVBJECTS now I guess!
> My experience is that most people who have trouble with
> objects do so because they try to make them much more
> complicated than they really are.
Actually I find a different prolem arises. Experienced
programmers tend to try to relate objects to their
prior knowledge. Thus they think an object is a C struct
with fields which are function pointers. Then they think
about messaging as simply a function call. Then they
think of inheritance as a code reuse mechanism. And
finally they think of class heirarchies as abstract
data types.
All of the above analogies are accurate to at least
some level. But all of them are fundamentally misleading
when trying to think in terms of objects as a
fundamental unit of code in their own right.
Its one reason that I have come to the conclusion that
teaching a C programmer OOP using C++ or Java is a
mistake - its better to teach something radically
different in syntax terms like Smalltalk or Lisp
(or more arguably Python). Then the tendency to
relate to previous knowledge is reduced. Smalltalk
is particularly effective because even the way you
write the code is different (in a class browser rather
than a file editor)
Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld
PS
The curious can look/learn about smalltalk at the
ObjectArts web site( http://www.object-arts.com/ ),
home of the excellent Dolphin smalltalk or alternativel
try the Squeak project at http://www.squeak.org...