The Null Device

Thought-provoking article on object-oriented programming and its discontents: (via RobotWisdom)
"You have your 'isa' hierarchy all thought out - let's say you have a "mammals" class and a "reptiles" class and so on - and you start to implement it, and along comes a platypus, a fur-bearing, egg-laying, duck-billed creature, which doesn't appear to fit in any of the classifications you've created. So what you often end up having to do is rethink your entire hierarchy, refactoring into a different set of basic categories, or maintaining several categorizations along different axes. A lot of your thinking ends up getting thrown out, as well as any implementation you've done up to that point."
I've heard a number of experts proclaim that the reason for the widespread popularity of OO design is "that's how the world really works." But the piece of paper on my desk doesn't have discrete methods. If I decide for example, to burn it for fuel, or fold it into a paper airplane, does that mean that there is a "burn" or "fly" operation that's somehow built into the paper, and that it inherits these operations from a superclass of "flat things"? ... Object Orientation is more of a statement about how our minds work than it is about how the world works. One of my favorite Buckminster Fuller quotes is "There are no things", which means that the division of the world into discrete "things" is due to the way we parse our visual input stream.
The C++ operator overloading feature is especially good at tricking programmers into mis-estimating performance impacts. For example, I've seen "smart pointer" classes which do mind-bogglingly large amounts of work (like acquiring/releasing a semaphore for thread-safe code) each time a pointer is assigned or a dereference is made. And I've seen other programmers who blithely use these smart pointers as if they were actually real C++ pointers...
What I've learned from this is that the re-use of the idea of hash tables is far more important than the re-use of actual written code.

There are no comments yet on ""

Want to say something? Do so here.

Display name:
URL:(optional)
To prove that you are not a bot,
please enter the text in the image on the right
in the field below it.

Your Comment:

Remember my details.

Please keep comments on topic and to the point. Inappropriate comments may be deleted.

Note that markup is stripped from comments; URLs will be automatically converted into links.