Is Python overhyped (just like Java)?

Thomas Bellman bellman at lysator.liu.se
Mon Mar 31 16:07:13 EST 2003


Roy Smith <roy at panix.com> writes:

> I'm all for C++ bashing, but in what way do you think C++ is not "a true 
> object oriented language"?

A common complaint is that it confuses implementation (inheritance)
with interface.  If a function expects a Frobnitz instance, then it
better get an instance of a class that derives its implementation
from the Frobnitz class, or the compiler will reject your program.
A class that implements exactly the same interface, but uses its
own implementation without inheriting from Frobnitz, won't work.

After a while it was realized that that was untenable, and
templates were invented to patch around it.

> I've heard C++ guys bash Python as not 
> object oriented because Python doesn't support private data.  "You mean 
> I can bypass the accessor functions and touch an object's data 
> directly!?"

Of course, that is possible to do in C++ too.  I would even contend
that it is actually *easier* to do so by mistake in C++ than in
Python; but it is easier to do so willingly in Python than in C++.
(And here is a hint for those that don't believe it can be done in
C++: pointer arithmetics.)

> OO seems to be different things to different people.  The concept of 
> "true OO" is probably best left for religeous wars.  As far as I can 
> tell, most people think OO is whatever was supported by the first OO 
> language they learned.

My first experience with object orientation was writing a small
OO library for INTERLISP, a LISP dialect running on PDP-10:s and
Xerox LISP machines.  When I wrote that, I had only read about
the concepts of object orientation, not seen any language with it,
and certainly not programmed using it.  (The first programming
course at university was learning LISP, and as part of it we had
to do a small programming project.  I wrote an adventure game
framework, and the OO library was part of that.)  Considering that
I had no previous experience with OO, I suppose my library was
fairly good.  That, however, was 14 years ago; I think I would have
designed it a bit differently, and hopefully better, today. :-)


-- 
Thomas Bellman,   Lysator Computer Club,   Linköping University,  Sweden
"What sane person could live in this world   !  bellman @ lysator.liu.se
 and not be crazy?"  -- Ursula K LeGuin      !  Make Love -- Nicht Wahr!




More information about the Python-list mailing list