Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Of course. EWD 1008, titled "On the foolishness of 'natural language programming'," is a short but incredibly influential and characteristically polemical essay by Edsger W. Dijkstra, written on August 6, 1979. Analyzing it in detail requires looking at its context, its core arguments, its proposed alternative, and its lasting legacy in the world of software development.
- ### 1. Summary and Core Thesis
- At its heart, EWD 1008 is a forceful rejection of the idea that programming languages should be designed to resemble spoken or written human languages (like English). Dijkstra argues that this trend is not just a bad idea, but a form of "intellectual terrorism" and a "regrettable mistake." His central thesis is that the inherent qualities of natural language—ambiguity, verbosity, and lack of formal structure—are fundamentally at odds with the primary requirements of programming: **precision, unambiguity, and mathematical rigor.**
- ### 2. Historical Context: Why Was This Written?
- To understand Dijkstra's passion, we must look at the computing landscape of the late 1970s.
- * **The Rise of "User-Friendly" Languages:** The era saw the proliferation of languages designed to be accessible to non-specialists. **COBOL**, with its English-like sentences (`ADD 1 TO COUNTER`), was dominant in business. **BASIC** was designed for beginners and spreading rapidly on early personal computers.
- * **A Push for Accessibility:** There was a strong belief, both in industry and academia, that for computing to reach its full potential, programming had to be made easier for the masses. The "natural language" approach was seen as a key to unlocking this future.
- * **Dijkstra's Position:** Dijkstra was a leading figure in the structured programming movement, which advocated for formal, logical, and provably correct software. He viewed the "natural language" trend as a dangerous step backward, a "foolishness" that catered to intellectual laziness and undermined the discipline of programming. He saw it as an attempt to solve a social problem (making programming accessible) with a technically unsound solution.
- ### 3. Deconstruction of Dijkstra's Core Arguments
- Dijkstra makes his case through a series of sharp, memorable arguments and analogies.
- #### **Argument 1: The Incompatibility of Ambiguity and Precision**
- This is his most crucial point. Natural language relies on context, shared understanding, and inference to convey meaning.
- * **Example:** Consider the sentence, "I saw a man on a hill with a telescope." Who has the telescope? Me or the man? The sentence is ambiguous. A human can usually resolve this from context, but a computer cannot. It demands a single, unambiguous interpretation.
- * **Dijkstra's View:** Programming is the act of instructing a machine, which is the ultimate "context-free" entity. Every instruction must have one, and only one, precise meaning. Trying to use a tool (natural language) defined by its ambiguity for a task that demands absolute precision is, in his words, "a disastrous mistake."
- #### **Argument 2: Verbosity Obscures Logic**
- Natural language is notoriously wordy. Dijkstra argues that this verbosity acts as "noise," burying the actual computational logic in a sea of redundant words and grammatical fluff.
- * **Formal Notation:** A mathematical or formal notation (like `x = x + 1`) is concise. Each symbol is essential and contributes directly to the meaning. This forces the programmer to think clearly and makes the program's structure easier to analyze and reason about.
- * **Natural Language:** A statement like, "Now we need to increase the value of the counter by one," contains the same logic but padded with unnecessary words. Dijkstra believed this makes it harder to see the program for what it is: a mathematical construct.
- #### **Argument 3: The "Caterpillar" Analogy**
- This is a classic Dijkstra metaphor used to illustrate the foolishness of regression.
- * **The Analogy:** He compares a programmer to a caterpillar. The caterpillar's destiny is to become a butterfly, a creature of magnificent complexity and grace. However, if the caterpillar were to look at an earthworm and think, "That's what I should aspire to be—it's so simple and close to the ground," and try to mimic it, it would be a tragic regression. It would be abandoning its unique potential for a more primitive form of existence.
- * **The Meaning:** For Dijkstra, the programmer's unique potential is to harness the power of formal abstraction and mathematical logic—the "butterfly." Trying to regress to "natural language"—the "earthworm"—is to abandon this potential for a form of expression that is ill-suited for the task.
- #### **Argument 4: The Fallacy of "Obviousness"**
- Proponents of natural language programming often claim it makes code "obvious" and "self-documenting." Dijkstra scoffs at this.
- * **The Problem:** What is "obvious" to a human writer is based on a lifetime of experience and cultural context. A computer has none of this. It cannot understand "common sense."
- * **The Illusion:** The illusion of obviousness is dangerous because it makes the programmer less vigilant. When using a formal language, the programmer is constantly aware of the machine's rigid logic. When using a natural-like language, they might be fooled into thinking the computer "understands" the intent, leading to overlooked bugs and logical errors.
- ### 4. Dijkstra's Proposed Alternative
- Dijkstra doesn't just criticize; he presents a clear alternative.
- * **Formalism as a Tool for Thought:** He advocated for programming languages that are not just a means of giving orders to a machine, but are formal systems that help the programmer *think*. The language should force a discipline of thought that makes deriving correct programs more natural.
- * **Mathematical Notation:** His ideal is closer to pure mathematics than to English. The focus should be on program *derivation* and *correctness proofs*, not just on writing code that "works." The programmer's role is that of a logician or a mathematician.
- ### 5. Critical Evaluation: Strengths and Weaknesses
- **Strengths (Where Dijkstra was Undeniably Right):**
- * **The Ambiguity Problem:** His central critique remains one of the biggest challenges in computer science, especially in fields like Natural Language Processing (NLP) and AI. The difficulty of parsing human intent is a testament to his point.
- * **The Value of Precision:** The discipline of writing clear, unambiguous, and well-structured code is the hallmark of a great software engineer. Dijkstra's call for precision is a timeless principle of good craftsmanship.
- * **Influence on Language Design:** While the world didn't fully embrace his mathematical ideal, his ideas heavily influenced the design of later, more powerful languages like Pascal, and later, functional languages like Haskell, which emphasize formalism and correctness.
- **Weaknesses (Where the World Didn't Follow):**
- * **Underestimating Human Factors:** Dijkstra largely dismisses the importance of cognitive load, learnability, and accessibility. For many tasks, a language that is easier to read and write (like Python) can be more productive, even if it's less formally pure.
- * **The Economic Reality:** Full formal verification is incredibly expensive and time-consuming. For a vast majority of software (e.g., websites, business applications), it's economically unfeasible. The industry prioritized getting working software out the door over proving its absolute correctness.
- * **The Success of High-Level Languages:** The trend continued *towards* higher levels of abstraction. Languages like Python, Java, and C# are vastly more expressive and less machine-like than assembly or even C. They are not "natural language," but they are a clear rejection of the idea that programming must look like pure mathematics to be effective.
- ### 6. Legacy and Modern Relevance
- EWD 1008 is more relevant today than ever, but in new and unexpected contexts.
- * **Low-Code/No-Code Platforms:** These are the modern embodiment of what Dijkstra feared. They allow users to build applications using graphical interfaces and natural language-like configurations. Dijkstra would undoubtedly be critical, pointing out their limitations for building complex, scalable, and robust systems. However, their success in specific, well-defined domains shows that the "foolishness" can be practical when the problem space is constrained.
- * **AI Code Generation (GitHub Copilot, etc.):** This is the most fascinating modern development. AI models are being used to bridge the gap between a developer's natural language comment (`// fetch all users from the database and sort by name`) and formal, syntactically correct code. This can be seen as an attempt to get the "best of both worlds." However, it also highlights Dijkstra's concerns: the AI is a statistical model, not a reasoning engine. It can generate code that is subtly wrong, insecure, or inefficient because it doesn't *understand* the logic in a formal sense. The problem of ambiguity hasn't been solved; it's been outsourced to a probabilistic black box.
- ### Conclusion
- EWD 1008 is a brilliant, uncompromising, and essential piece of writing in the history of computer science. Dijkstra makes a powerful and enduring case for the intellectual discipline of programming. While the industry did not follow his path to the letter, his core warning against the seductive dangers of ambiguity and imprecision remains a vital lesson for every programmer. The debate he ignited—between formalism and pragmatism, between precision and accessibility—continues to shape the tools we use and the way we think about building software today.
Advertisement
Add Comment
Please, Sign In to add comment