So… ‘objects’. Dominant paradigm of the past two decades, golden hammer of the masses, and the subject of many a blog post. But why exactly is this programming paradigm so popular? I believe it’s quite simple — they express things in a way we intuitively think.
Since the days of antiquity we have sought to understand the world by dividing it into smaller and smaller parts. The ancient Hindu school of Vaisheshika, for example, postulates that all physical objects can ultimately be reduced to an assemblage of paramāṇus (atoms), and the English word ‘atom’ stems from the the Greek word for the same concept: ἄτομος (atomos), which means ‘indivisible’. Furthermore, both Indian and Greek philosophers propounded an object theory with which to understand reality.
In Ancient Greece, it was Plato who pioneered the concept of objects. He distinguished the perfect, idealistic concepts of things from their myriad imperfect physical manifestations. Plato’s immaculate concepts, what he called ‘forms’, are not unlike OOP’s class definitions — a sort of blueprint for the object. In turn, the physical manifestations correspond to what object-oriented programming would call ‘instantiations’.
Building on Plato’s work, Aristotle provided a key advancement to object theory: categorization through hierarchy. Through the use of hierarchy and classification, Aristotle founded over a dozen branches of science (then considered branches of philosophy) including physics, linguistics, biology, and zoology. Although the ancient Greeks did not have the advantage of DNA classification, they made significant headway by classifying beings directly by their visible traits, such as color, shape, and size. Siberian and Bengal tigers can be inferred to be more closely related to each other than with a penguin, since nearly all of their traits are the same. In an object-oriented program design, Bengal Tiger and Siberian Tiger might both inherit from Tiger, which is a type of Cat, which is an Animal, which is a Being (though most hierarchies would descend from Object).
The history of object-oriented programming is a long and fascinating study, but I think the ultimate cause of the paradigm’s success is rooted in a fundamental principle of software engineering. As M. Fowler put it, “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” Although introductory courses seem to be trying their best to make OOP feel like a complicated and confusing subject, the fact remains that decomposition — understanding things by understanding their parts — is a way of understanding the world that has been around for over a millennium. It’s debatable whether this way of understanding the world is innately intuitive, but at the very least it has been engrained in Western culture for a very long time.
The jury is still out on whether reductionism is a suitable end-all be-all approach to understanding the cosmos, but in the meantime that doesn’t much matter to the craft of programming. Code is an invented art which, like math and logic, can abide by its own rules. 1 + 1 = 2 by definition; from select axioms, the rest follows logically. All that really matters is that the system you are implementing is internally consistent. (In fact, I would rather deal with a simple system that does not reflect reality than a complex one which attempts to.)
When you’re building castles in your mind, you need not obey the rules of earth.