Why software language is better than human language

Dotan Reis
3 min readMar 1, 2021

Austrian philosopher Ludwig Wittgenstein, commonly considered one of the greatest philosophers of the 20th century, was very skeptic of philosophy in general. He thought that many philosophical questions were really just misunderstandings, by the philosophers, of the way language works.

Philosophers, for example Socrates, would have the assumption that words have definitive, non changing meanings, and that it’s the role of the philosopher to find this meaning. Wittgenstein would say that this assumption is like assuming that when children play with a ball, at every single point in time there are definitive rules to the game they’re playing.

What are the rules? (Photo by Robert Collins on Unsplash)

Wittgenstein thought that to know what a word means, you have to look at how and when people use it. That’s the meaning of the word, nothing else. The philosophical investigation into these things is just unnecessary (He literally ended his first book with “[about these things,] one must be silent” which probably sounds even harsher in German).

What does all this have to do with programming? It is well established that naming things (i.e. finding words for them) is one of the two hardest things in programming. I think this is true: when something has a name that defines it exactly, everyone immediately knows how to work with it, what it can and cannot do, and generally what to expect when using it.

Naming is also a bit philosophical: you find yourself asking question like: “What is the purpose of this thing?”, “What does it really do?”, “Why do we need it?”. Often naming the thing can actually help you fine-tune it and understand it better yourself.

Which brings me back to Socrates. When we name parts of our software, are we assuming a stable, definitive meaning when actually there is none? The law of leaky abstractions hints that there may be something to it. In a nutshell, the law states that when we create an abstraction (like a name) we are trying to hide complexity, but the complexity is never fully hidden.

The light switch abstracts the complexity of electric wires, gateways etc. (Photo by Isabella and Louisa Fischer on Unsplash)

For example, say you have a library that exposes two functions: “add_user_name” and “get_user_name”. Users are identified by ID and the names are string. What the library does internally is, it holds an array of users, and when “get” is called it searches the array for the user ID and returns the name.

We can suspect that when the array becomes too big the library will become slow. But this is not what you understand from the names “add_user_name” and “get_user_name”! The implementation “leaks” over the abstraction, and the developer debugging this will have to look under the hood in order to solve the issue.

Wittgenstein once said “Nothing is so difficult as not deceiving oneself”. I think “deceiving” here can mean thinking that we can reduce complexity into abstractions. It’s looking at the names, not the implementation, and expecting things to work according to that. His philosophy is considered almost therapeutic in the way that it tries to alleviate some of the unrealistic expectations and confusions people have.

Not deceiving oneself (Photo by Juan Rumimpunu on Unsplash)

Wittgenstein doesn’t oppose words, “there’s nothing wrong with the natural language” he said. But he does suggest that we don’t misunderstand how it works.

As programmers, we are lucky to not only use language but also create and fine-tune its meaning. In a sense, code is far simpler than natural language. The names we give things, leaky as may be, are still better defined than abstract words like “ethics”, “time”, or even “game”, which concern philosophers.

And when they’re not, we can change that. Unlike philosophers, we can make our language better at being what the abstraction says it is — But that’s for next time.

Further reading:

--

--

Dotan Reis

Software developer @ riseup. MA student @ The Cohn Institute in Tel Aviv University