So What's the Big Deal about Objects?

David Policar 1994.

I'm a technical writer for a computer company that produces an object-oriented spreadsheet for NEXTSTEP and is currently developing another one for OS/2. Basically, it's my job to establish a telepathic rapport with the development team and translate their ravings into English.

One of the hardest things to translate into English has been the whole "object" thing itself. Lots of enthusiasm, lots of energy, lots of hand waving and metaphors and analogies, all of which make perfect sense, but when it comes time to explain to a non-programmer what makes object-oriented programming so cool, it all sounds pretty silly.

This morning, while listening to our head of development expound about objects to a new hire, I suddenly understood why it's so hard to explain what's cool about object-oriented programming to non-programmers. The reason is:

There's nothing cool about it.

Why do I say this? 'Cuz the entire world we grow up in, and every tool and every environment we are accustomed to using, and our whole context of interacting with the world, is already object oriented. Object-oriented programming just makes software work more or less like all the things we're already used to.

Say you're driving across the country, and you get lost in the back roads of Michigan without a map. What do you do? Simple -- you stop and ask directions of the first person who walks by. Wherever you happen to be, there are people who have information about streets and landmarks, even though you didn't put them there, you didn't assign them any of that information, and you most likely don't have the foggiest clue who they are... they're just there. Not only that, if you ask for directions in Michigan, you get directions about Michigan, not New York, even though you have done exactly the same thing.

Isn't that cool???

Well, no, it isn't. You expect it. It's not worthy of comment. But if you're driving in the world of C programming, it doesn't work this way at all. If you're lost in Michigan, you look in your glove compartment for the "Michigan" map, and look up your location and your destination on it, and figure out your best route. If you don't have a Michigan map, well, you're out of luck. (Maybe, if you are a well-written C program, you start looking around in places where someone else might have left a map of Michigan lying around, but if there isn't one around, you are out of luck again.) There aren't any people around you didn't put there, and they don't know anything you didn't tell them to begin with.

And this is a simple example. In the world of C programming, if your car breaks down in Montana, buying a new car to get to Seattle is this enormous project, involving major surgery on your hands and feet so they can manipulate the steering wheels and pedals on your new car... basically, be prepared to spend 6-8 months in Montana learning to drive all over again (it's like moving to London, but infinitely worse). In the world of object-oriented programming, you just get a new car and keep going. Yes, the engine may be completely different, but who cares?

The power of object-oriented programming is that you can separate the program that is performing the task (in this metaphor, the driver) from the various things that the program needs to interact with to perform the task (in this metaphor, local residents, the car, etc). As long as there is a certain base level of communication ability (ie; you speak the same language, you both understand what "directions" are and how one goes about giving and using them, you know what a steering wheel is, etc.), "you" (that is, the program) don't need to care about what else "they" (that is, the objects) are doing, how they are built, what else they do when they aren't giving you directions, etc. You can use objects you haven't created yourself; in fact, you can use objects that didn't exist when you were written. Other programs can use the same objects, perhaps to do something entirely different (who knows what the locals do after you drive off?).

In other words, the world according to object-oriented programming is kinda like the ordinary world we've lived in all of our lives, which for most of us is nothing to write home about, and the bright-eyed programmers bursting at the seams with enthusiasm about it seem a little bizarre. Since these are bright people, we conclude that we must be missing something, and object-oriented programming must be this complicated thing we just don't understand.

It isn't. To understand why programmers get so excited about it, we need to understand that the world according to procedural programming is a strange and lonely place, and that programmers are used to it and think it's normal. (This may explain why programmers are so weird sometimes.) When they are introduced to the world that you and I have lived in all our lives, they get all excited, which can be confusing to us natives until we realize what the world they come from is like.

It's like introducing an emigree from strongly totalitarian countries to an American supermarket. What's so cool about a supermarket? Well, to an American, nothing much. It's just a supermarket. But to such an emigee, it's a completely alien thing... you just walk in, find the things you want, take them, pay for them, walk out... and you have them??? And... if you need different things, you just go back in and get those, instead??? And nobody tries to arrest you??? Cool!!!

So the next time a programmer gets all enthused about how object-oriented programming is going to change the face of computer software, don't get bewildered or confused. Just smile, pat him or her on the head, and say "Congratulations! Welcome to Earth, we hope you enjoy it here."