New to OO concepts - re-usability

Chris Hanson cmh at
Thu Feb 22 09:13:59 EST 2001

In article <CgJk6.515$v77.66568 at>,
Chris Tavares <ctavares at> wrote:

> While the world is totally different (static vs. dynamic typing), the
> concepts are in many ways the same. Studying the ideas behind the STL are
> well worth doing for everyone I would think.

It's a great idea for learning what *not* to do.

The STL is horribly designed.  There's no hierarchy, no real
interchangeability in the container classes.  And they force you to do
all sorts of extra work (some of which just isn't feasible) to be able
to store your objects in containers.

STL was designed by number crunchers with the broken assumption that
programs are designed from the algorithm out and that efficiency is the
absolute most important goal.  Software in the real world is designed
from the business requirements out; this usually starts with a human
interface and a set of user requirements, and efficiency is only
measured compared to human use rather than the processor's maximum

I've actually had STL proponents tell me it's a *good* thing that
std::vector<T> doesn't have a push_front() method because if you try to
do that your code won't compile and you'll know you should be using a
"more efficient" container class!  What if I *know* it's an expensive
operation, I know I need to do it occasionally, and I need the speed
that std::vector<T> will otherwise give me?  "Subclass std::vector<T>
then!"  (This was the real answer they gave.)  If I have to subclass a
standard container class to get simple functionality, it's *not*

Study the Smalltalk frameworks and Apple's Cocoa frameworks (formerly
the NeXT frameworks) if you want to learn good object-oriented design. 

  -- Chris

Chris Hanson <cmh at> Making business distributed.

More information about the Python-list mailing list