lies about OOP

Roy Smith roy at
Wed Dec 15 00:27:55 CET 2004

Terry Reedy <tjreedy at> wrote:
> I did not really 'get' OOP until after learning Python.  The
> relatively simple but powerful user class model made more sense to
> me than C++.  So introducing someone to Python, where OOP is a
> choice, not a mandate, is how *I* would introduce a procedural
> programmer to the subject.  YMMV.

OOP is a choice in C++ too.  You can write procedural C++ code; no
need to use classes at all if you don't want to.  Something like Java
is a different story.  Java *forces* you to use classes.  Nothing
exists in Java that's not part of some class.

I think the real reason Python is a better teaching language for
teaching OO concepts is because it just gives you the real core of OO:
inheritence, encapsulation, and association of functions with the data
they act on.

C++ has so much stuff layed on top of that (type bondage, access
control, function polymorphism, templates) that it's hard to see the
forest for the trees.  You get C++ jocks who are convinced that that
stuff is part and parcel of OO, and if it doesn't have (for example),
private data, it can't be OO.

More information about the Python-list mailing list