[OT] about OO concepts

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Tue Mar 30 17:28:03 EST 2004


Hung Jung Lu wrote:
(snip)

> 
> I think the current way how OOP is taught is kind of bad. The lectures
> would start with definition of classes, inheritance, virtual
> functions, etc.
> 
(snip)

> I often don't know how to take it when I see people talking about OOP
> by using definitions like: polymorphism, data hiding, etc. As if these
> definitions were something of utmost importance. 

Well, last time I tried to explain OOP I started with the 'object' 
concept (object = id + state + behavior), then came to the 'class' 
concept, first defined as 'a class is the set of objects that share the 
same behavior'. It's hard to tell because no two brains works the same, 
but it seemed that the person I was trying to teach OO found this 
approach quite clear...

> To me, OOP is just a
> tool for factorizing code, just like using for-loops and using
> functions to factor out repetitive code. Polymorphism, data hiding,
> etc. are all secondary features

Err... I would not say that polymorphism is 'secondary'. It's IMHO one 
of the most important concepts in OO.

(snip)

> A CS professor friend of mine once said: "all problems in CS are
> solved by just one more level of indexing," 

IIRC, the exact quote is : "any problem can be solved by adding a level 
of indirection - except for 'too much levels of indirection'" (now don't 
ask me who said this !-)

Bruno




More information about the Python-list mailing list