As someone with experience working as a Software Engineer with a Bachelor’s Degree in Linguistics and a Master’s Degree in World Languages, I am frequently asked if programming languages and spoken or human languages are basically the same thing. While this is largely a philosophical question based on how you define language, here is my take on the matter.
What is language?
Human languages are methods of communication between people. Asking questions about how to fix your drywall, telling stories from your childhood, or shouting your excitement as you watch your team score are all ways we use language. Whether this is English, German, Russian, Mandarin, or American Sign Language, every language has the ability to communicate wants, emotions, questions, and complex ideas.
Programming languages are ways to tell a computer what to do. Printing text, displaying images, running a version of Asteroids or Tetris, or saving financial data are all examples of what a programming language might make a computer do.
The main difference is who the message is intended for; people or computers. But there are many similarities, too.
Similarities between programming and human languages
Both human languages and programming languages can make things happen. Spoken words can change people’s perspectives and lead to massive action. Programming languages can be used to help people learn complex concepts through games, or to save and display information that leads to decision making and change.
Another similarity is that both human and programming languages have developed over time. We no longer speak the Old English that Beowulf was written in, and (hopefully) we no longer program in COBOL. Both kinds of language can become extinct when no one uses them any longer. Both can develop and introduce new concepts, though it could be argued that human languages do so naturally, while programming languages do so in a planned way.
In both programming and human languages, it is an art to express yourself well. Someone can speak with a ton of “um”s and have a hard time getting their message across, or a great orator can express things in a way that truly touches people. A programming language can be used in a way that it is almost impossible to read or understand, with redundancies and extremely long files, or a program can be divided into reusable pieces that are well named and make perfect sense.
While these may seem like significant similarities, they are actually extremely generic. I could make the exact same comparisons between language and basketball. When I play basketball, I make things happen. I help my team advance or fall back defensively, and contribute to the overall score. The game has changed historically. Even the ancient Mayans had a game where part of the goal was to get a ball through a high ring – versions of such games have existed for millenia. Today, the rules are very established and written down, but there are still changes periodically. And if you watch a professional basketball player, you could certainly argue that what they do is artistic expression. So, while these are similarities, they do not make a good argument for saying programming languages and human languages are the same thing.
Differences between programming languages and human languages
One of the major differences between a human language and a programming language is the time it takes to learn due to the massive complexity and range of expression of human languages. While it may take time to pick up the nuances, an experienced software engineer can learn a totally new language within a few days, if not less. But, if you went to an experienced Spanish speaker and asked them to start working in Japanese next week, they would probably question your sanity.
Of course, there are sometimes considerable differences between programming languages that may take longer to get used to, like between imperative and functional languages, or languages where you have to explicitly manage memory and variable types versus a language like Python, where types are not explicitly declared, but these complexities are still easier to master in comparison to the vast complexities and nuances of human language. The logic behind programming languages is fairly universal and easy to understand despite language differences. Even if I understand how human languages are constructed and the different ideas I want to express, it can easily take months before I can communicate well enough to comfortably live in another country.
Another distinction I think is important is between rules and patterns. While we commonly say that human languages have “rules,” they are constantly broken without impacting the listener’s understanding. When I was teaching first-year Russian at a university, my students knew that whenever they asked if there were exceptions to a rule, the answer would always be “yes.” An obvious example is the past tense in English. Just add “ed” to the end of the verb, right? So, “to go” should become “goed” and “to be” should become “beed.” Perfect. I can also break normal language conventions all the time and be perfectly understood. I can say “nah” instead of “no” or make grammatical errors and still have no problem communicating. So I would actually refer to most of the “rules” in human language as “patterns.” They may indicate how language tends to work, but they don’t always have to be followed in the way the word “rule” implies.
Programming languages, on the other hand, are extremely prescriptive, and there are true rules that have to be followed. In C++, if you miss a semicolon at the end of the statement, the entire program may not work at all. I could switch the order of a couple lines of code, thinking, “the computer will still understand. It should still work.” And the computer will not do what I want it to do. While there are various ways that a single problem can be solved or a single line of code could be written, the rules have to be followed. While there are also mistakes you can make in human language that would “break” the conversation and lead to misunderstandings, they are very different from programming errors.
Finally, computers don’t actually understand human language. Machines simply follow instructions that we happen to have organized into human words to make them easier for humans to write. But, in the end, it’s about logic and voltages and controlling whatever actions the machine is capable of completing. Giving clear instructions to a machine is extremely different from communicating with another complex, emotional, unpredictable human being.
So, are programming languages actually languages?
I would argue that programming languages are the same as human languages in the same way that math or art or kung fu can be viewed as a language. They all involve words and complexity and artistry, but the purpose and functionality are very different. So, no, they’re really not the same at all.
Do you agree or disagree with my evaluation? Share your thoughts in the comments!