protocols, inheritance and polymorphism
Donn Cave
donn at u.washington.edu
Wed Nov 24 12:24:22 EST 2004
In article <s4qdnUDCJoJ9vjncRVn-hA at rogers.com>,
"Dan Perl" <danperl at rogers.com> wrote
...
> It's hard to argue against Smalltalk. I haven't used it for many years so I
> don't remember it but it was THE language of choice for an OOP course I took
> oh so many years ago. And I still see it mentioned as a model for OOP. I
> never learned Objective C so I cannot argue with that either.
> Unfortunately, as much as I am learning to like Python, I don't think I see
> it as a picture perfect OOP language. It may be a controversial opinion but
> I am not at all satisfied with encapsulation in Python (you cannot hide any
> of a class's implementation).
> Can you elaborate on problems that static languages have with OOP? We have
> been touching on parametric polymorphism and that is a valid point. I also
> see multiple inheritance as being very poorly implemented in C++ and Java to
> the point where books on C++ that treat the subject discourage you from
> using it and Java has effectively designed it out of the language (you can
> implement many interfaces but you can extend only one class). What do you
> have in mind?
I am really too unschooled in these matters to pursue that.
I have mentioned Haskell a couple of times, and that's my
perspective on static typing. I recommend it as an interesting
exercise: learn Haskell, find out what static typing is about.
It isn't perfect, but it's leagues ahead of C++ etc.
I don't have any beef with multiple inheritance, in fact the
notion of "mix-in" classes might have some potential to be the
basis for a more sound approach to OO.
Donn Cave, donn at u.washington.edu
More information about the Python-list
mailing list