Monday, September 22, 2003

The Physically Rooted Metaphor of Programming

Programming is among the most abstract of human intellectual activities: designing a series of electrical charges and impulses to act in concert, manipulating other charges that, in turn, stand for the abstraction of numbers, or further layered abstractions of other functions or locations. Pretty abstruse stuff.

So why are the dominant metaphors of programming so rooted in physical reality? Data flows from sources to sinks, just like water through a pipe. We use handles to refer to objects. Two nodes handshake. We take the address of variables. We load a program into memory, as if loading cargo into a wagon. This is not even to mention the design patterns, inspired as they are by physical architecture, and of course object-oriented programming which is most obviously a metaphor rooted in the very idea that pieces of programs are like physical things. And don't get me started on the Turing machine.

It's not actually that hard a question to answer. We use physical metaphors because that's what our brains are hardwired to understand. George Lakoff would claim that all of our cognitive metaphors are, ultimately, rooted in physical reality. Is this why other metaphors, like functional programming, farther removed as they are from a physical basis, are less popular even if more powerful?

But what's surprising is not that our metaphors are rooted in physical reality, but that there's been so little experimentation. Why not a journey? Why not a conversation? Why not learning a dance instead of building a house? Why not keeping bees instead of laying pipe? Why not boxing, or climbing a mountain, or writing poetry, or appreciating art, or raising a family?