The Languages of Machines and Humans: A Developer's Perspective
As software engineers, we spend our days immersed in programming languages. But have you ever stopped to consider why we call them "languages" in the first place? What do they truly share with the natural languages we use to communicate with each other?
There is my article (original Russian article: https://sysblok.ru/blog/blog_b_orekhov/jazyki-mashin-i-ljudej/), where I reflect on this question from a new angle.
Beyond the Obvious: Practice and Purpose
Yes, both programming and natural languages require dedicated practice. The parallel is straightforward—the more you immerse yourself and practice, the more fluent you become. But the similarities run deeper when we examine how these languages are structured and what they're designed to achieve.
The fundamental purpose of any language is to convey information. Natural human language evolved as an evolutionary advantage, enabling coordination and collective achievement. Programming languages emerged out of necessity—the problems we needed computers to solve were so complex that we required a flexible, structured medium to describe them.
Why Assembly Isn't the Answer
We all know that computers don't "think" in Python or Java. They operate on machine code—highly formalized processor instructions that deal with numbers and registers. Machine code is efficient for machines but incomprehensible to humans:
BB 11 01 B9 0D 00 B4 0E 8A 07 43 CD 10 E2 F9 CD 20 48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21
The problem is simple: while a handful of savants can think in machine code, it's error-prone and slow for the rest of us. Programming languages emerged as a bridge—a human-readable intermediate form that could be automatically translated into machine code.
The Illusion of Natural Language in Code
Here's where it gets interesting. Programming languages use English keywords and familiar syntax, but this is where the similarity with natural language ends.
Consider how natural language describes the world. Russian says "идет дождь" (literally "rain goes")—implying an active agent performing an action. English says "it rains" (less metaphorical but still with a placeholder "it"). These are useful fictions that help us communicate about the world.
Programming languages? They're built on declarations and commands. The most common form of expression in code is the imperative mood—do this, take that, place the result here.
This limitation is by design. Programming languages are deliberately engineered to prevent ambiguity, metaphor, and imagery—the very things that make natural language rich and expressive.
What This Means for Developers
Expressive Power: Natural languages are universal—they can describe anything from quantum physics to the color of a sunset. Programming languages are specialized tools with limited expressive range. Try describing a past event or emotional state in pure Python—you'll quickly hit a wall.
The Variable Trap: You can name a variable spiritual_thirst, but it'll never mean what it means in a poem. To the compiler, it's just a container for a value. This is a crucial distinction—words in natural language carry meaning; variables in programming languages carry values.
Purpose Shapes Structure: Natural language tells stories; programming languages give commands. This fundamental difference shapes everything—syntax, grammar, and capabilities.
The Nuance: Creativity Within Constraints
To be fair, programming languages aren't entirely devoid of storytelling. You can write (somewhat) expressive code with the right abstractions. But the article makes an excellent point—it's like trying to write a novel using only imperative sentences from an appliance manual. You technically can, but it won't be Tolstoy.
The article also mentions esoteric languages like Shakespeare (where programs look like plays) and poetry written in code. These experiments are fascinating precisely because they push against the inherent limitations of programming languages as expressive media. They highlight the constraints rather than transcending them.
Takeaway for Pragmatic Programmers
Understanding the nature of programming languages isn't an academic exercise—it informs how we think about our tools. Programming languages are not just simplified natural languages. They're fundamentally different artifacts designed for a different purpose: precise, unambiguous instruction execution.
When we teach programming, we should be clear about this distinction. Newcomers often struggle because they expect programming languages to behave more like natural languages. Recognizing that code is about telling a machine what to do rather than describing the world is a crucial mental shift.
We can't write poetry in C, and we can't compile Shakespeare. Understanding why helps us choose the right tool and write better, clearer code—and appreciate each language for what it is.
For a deeper dive into this topic (in Russian), check out this related video: https://www.youtube.com/watch?v=dfZY__1fhPo