Quiddity, Haecceity, and the Singleton Class: A Medieval Scholastic Take on Object Oriented Programming in Ruby

Why is this thus? And what is the reason for this thusness?

— Artemus Ward, Moses, the Sassy

And if you gaze long into a navel, the navel also gazes into you.

— Friedrich Wilhelm Nietzsche, Beyond Good and Evil (paraphrase)


  • quid·di·ty (/ˈkwɪdɪti/; Latin: quidditas) n.: the particular qualities shared by all things within a category.
  • haec·cei·ty (/hɛkˈsiːɪti, hiːk-/; Latin: haecceitas) n.: the particular qualities which distinguish a thing from others within a category.

In the High Middle Ages, European medieval scholars recovered the Greek classics, thanks to their Muslim friends who had preserved the works of Aristotle, Plato, Euclid, and the rest. The Europeans took a very peculiar point of view on these works. They assumed the ancients had already figured out the universe. The only task remaining to them, the medieval scholars, was to figure out what the ancient writing meant.

They did this through arguing—either in person or through commentaries they handed down to one another through the years. This intellectual slap-fighting gets the fancy name of “dialectical reasoning.” They found a lot to argue about. Sometimes, the scholars would even invite the general public to ask questions in an ask-me-anything format they’d call quodlibetical questions. Making the ancient explanations of the world make sense in the face of both Christianity and how the world actually worked involved a lot of rhetoric.

This environment served as a fecund ground for lengthy discourses on how existence itself worked. The hard work of trying to reconcile all the things which medieval scholars required to be true about the world ended up being called scholasticism.1 I’m going to level with you here—most of it is of little relevance today. What, you never heard of such towering intellectual figures as William of Auvergne or Henry of Ghent?

You must’ve heard of Duns Scotus. He’s considered one of the “three great” philosophers of scholasticism, along with Thomas Aquinas (a guy you probably did hear about in school) and William of Ockham (a guy you probably remember from his razor commercials). Just in case you haven’t heard of Duns Scotus, a few pretty interesting ideas came out of this guy, like quiddity and haecceity.2

He asked, what features of a thing made it belong to a category (quiddity)? What features of a thing distinguished it from other members in a category (haecceity)? This goes deeper than merely identifying what something is or telling apart two things.

Asking about a chair’s quiddity, for example, was akin to asking what features made it a chair at all. What changes could you make to a chair until it would no longer be a chair? (Do you recognize echoes of Platonism?) This is a little like a Ship of Theseus question: If I began to shave off one millimeter of a chair with a giant blade, with which cut does it cease to be a chair? What property did I break? What’s more, does the quiddity of chairs still exist even if I break every chair in the world? When the first chair was built, did that quiddity pop into existence then?

Haecceity, on the other hand, went beyond distinguishing among many objects. It was about identity itself. What made a thing one thing and not another? Why are you you and not someone else? Why do you remain you? What gave rise to plurality in the first place? This is to say, why is quiddity even distinct from haecceity? Why don’t we live in a universe where there is a single one of everything, where the idea of a thing is itself the singular instantiation of it?

And here, I’ve only considered a concrete object. In a pluralistic, materialistic universe, it’s trivial to think about individual instances of a category of thing—about something’s haecceity—until you start to apply it to abstract concepts, which aren’t material. What about colors? Can you have multiple individual instances of the concept of the color red? What does that mean? If there aren’t individual instances, does that mean that, out there, somewhere, is there some universal, singular instance of red? Do abstract ideas really exist in any real way in a materialistic universe due to the concept of haecceity?

Duns Scotus probably would’ve enjoyed programming languages, if only because they reify these questions as design decisions. I’m imagining him learning Common Lisp and discovering keyword symbols. What is the haecceity of an interned keyword symbol, like :ordnatio? There’s only one in the entire Lisp interpreter. It’s a unity of being.

Other things are universal in their being, too, within the interpreter, like packages and functions. Yet they have a real existence—a singular universal hosted within the interpreter forever (or at least until garbage collection). There are even abstract concepts which are built into Lisp itself—like the taxonomy of the empty list, or nil (the only false-like concept Lisp acknowledges), versus not-empty/not-nil/true (all the same when taken as an expression).

Since I’m certain you all know Common Lisp inside and out already, maybe looking at Ruby would be interesting. Scotus would probably notice first how Ruby “borrowed” keyword symbols as its own symbol feature. Same idea—once the symbol exists (a kind of Platonic ideal floating in the ethereal stack of the Ruby interpreter), it’s lodged there for good and reused whenever the same symbol is referenced. It’s a symbol the way the color “red” is a symbol for an idea in reality, a proxy for an abstraction.

Ruby is strenuously object-oriented, though. Object-oriented programming is thought to let programmers model the real world more easily. Scotus might have agreed. Classes map pretty well to quiddities; objects, to haecceities. Before object-oriented programming, most things lived singularly and eternally (except for, say, automatic or dynamic variables): functions, structures, literal values, and so on.

A quiddity can be described as a class, a conceptual proxy cookie-cutter from which individual objects can be instantiated. Haecceity is realized as an #object_id method which distinguishes each instance and helps Ruby keep track of which object is which in a durable way.

But haecceity can be more than just distinguishing things from one another or even maintaining identity. It includes the nature of things as individual. Many object-oriented programming languages include an idea that an object may take on a life of its own, but Ruby centers the object over the class in multiple ways.

You can create objects entirely without classes at all and imbue them with attributes and methods by calling Object#new.

scrooge = Object.new
def scrooge.lyric
  puts 'life is like a hurricane'
end
scrooge.lyric  # prints 'life is like a hurricane'

What is the quiddity of scrooge? It is something like an Object (a base class in Ruby), but it has taken on a new life, and it has a quality distinct from all other Objects. Does it still belong to the class of Object?

Ruby makes a distinction here which I think would make Duns Scotus look like Dunce Scotus. You’re welcome to ask Ruby what class that scrooge belongs to, using the #class method, and you’d get the answer of Object, but you can also ask for its #singleton_class, and you get something faintly different: #<Class:#<Object:0x00007f95017ed2e8>> (or similar). Ruby is communicating that scrooge has a singleton class which started as an Object but is now its own thing. Its quiddities have their own haecceities: the categories of things are not just immutable, singular universals but individuable concepts with pluralistic existences which you create at will anytime you instantiate an object. Ruby gives every object its own singleton class because it centers the object over the class, and in doing so, it acknowledges that each object has its own destiny which can be described as having its own qualities.

For what it’s worth, I am pretty sure that examining the idea of Ruby’s singleton class via medieval scholastic philosophy cannot be significantly more convoluted than any other explanation of the idea I’ve read online. Considering that I haven’t done any proofreading, research, or fact-checking, it’s bound to be at least fifty-percent correct, but you should check your local Ruby install for more information about singleton classes, Duns Scotus, or scholastic philosophy.