Prompt Engineering Is Programming
metaphor
Source: Software Engineering → Artificial Intelligence
Categories: ai-discoursesoftware-engineering
Transfers
Crafting prompts for large language models described as “engineering” — a deterministic discipline applied to a stochastic system. The metaphor imports the entire structure of software development: there is a specification (what you want the model to do), an implementation (the prompt text), a testing process (checking outputs), and an iteration cycle (refining the prompt). The practitioner is an “engineer” — a professional with transferable skills, not someone guessing at incantations.
Key structural parallels:
- Prompts as programs — just as a program is a precise set of instructions that a compiler translates into machine behavior, a prompt is a set of instructions that the model translates into output. The metaphor makes prompt-writing feel like a legitimate technical skill with learnable patterns, not an art or a lottery.
- Engineering implies determinism — the word “engineering” carries the expectation that the same input produces the same output. Civil engineers build bridges that reliably bear loads. Software engineers write code that deterministically transforms data. Calling prompt craft “engineering” imports this expectation of reliability onto a system that is fundamentally probabilistic.
- Professional identity — “prompt engineer” is a job title. The engineering metaphor transforms what could be described as “talking to a chatbot” into a professional discipline with expertise, best practices, and career trajectories. The frame legitimizes both the practice and the practitioner.
- Debugging as iteration — when a prompt produces bad output, the engineering frame calls this a “bug” to be “debugged.” The practitioner modifies the prompt (patches the code), reruns it (recompiles), and checks the output (runs the test suite). This structured approach to prompt refinement is directly inherited from software development methodology.
- Abstraction and reuse — prompt “templates,” “libraries,” and “frameworks” borrow software engineering’s abstraction hierarchy. The metaphor suggests that good prompts, like good code, can be modularized, versioned, shared, and maintained as engineering artifacts.
Limits
- Programming is deterministic; prompting is not — the same prompt sent to the same model at different times can produce different outputs. Temperature, random seeds, model updates, and context all introduce variation. No software engineer would accept a compiler that produces different executables from the same source code on different runs. The engineering metaphor must ignore the fundamental stochasticity of the system, which is not a minor detail but the defining characteristic of LLM interaction.
- Code has formal semantics; prompts do not — a programming language has a specification that defines exactly what each construct means. The meaning of natural language in a prompt is interpreted by the model’s statistical patterns, not by formal rules. “Be concise” means whatever the model’s training data suggests it means. There is no specification to consult, no compiler error when semantics are ambiguous.
- Engineering scales; prompt craft may not — software engineering principles (modularity, abstraction, testing) were developed because they enable systems to scale. It is unclear whether prompt engineering scales in the same way. A prompt that works for one model version may fail on the next. A prompt library cannot be unit-tested with the same reliability as a code library. The engineering frame promises a maturity that the practice has not demonstrated.
- The engineer controls the machine — in software engineering, the programmer has complete authority over the machine’s behavior. The machine does exactly what the code says, no more and no less. A prompt engineer has influence, not control. The model may follow instructions, ignore them, reinterpret them, or produce outputs that bear no relationship to the prompt’s intent. The engineering frame understates this fundamental power asymmetry.
- Incantation might be the better metaphor — critics note that prompt engineering often resembles ritual more than engineering: adding “think step by step” works not because anyone understands why but because empirically it does. Saying “you are an expert” improves outputs through a mechanism nobody fully grasps. This is closer to incantation than to engineering, where the practitioner understands the causal chain from input to output.
Expressions
- “Prompt engineering” — the core term, importing the full weight of engineering as a discipline
- “System prompt” — borrowing “system” from operating systems, implying a foundational layer of control
- “Prompt injection” — borrowed from SQL injection, mapping a security vulnerability onto prompt manipulation
- “Chain-of-thought prompting” — structured reasoning instructions framed as a programming technique
- “Few-shot learning” — providing examples framed as programming by demonstration
- “Prompt template” — borrowing the template concept from software development
- “You are a helpful assistant” — the most common system prompt, an instruction written as if programming a role
Origin Story
The term “prompt engineering” emerged in the AI research community around 2020-2021 as large language models became capable enough that the quality of the prompt significantly affected the quality of the output. The engineering framing was not inevitable — alternatives included “prompt design” (importing design thinking), “prompt craft” (importing artisanal skill), and simply “prompting.” That “engineering” won reflects the software industry’s preference for terms that convey rigor, repeatability, and professional status.
Furze (2024) documents how the engineering metaphor shapes expectations: it implies that prompt quality is a matter of technical skill rather than luck, that best practices can be codified, and that the discipline will mature toward reliability. The metaphor is productive — it encourages systematic experimentation rather than random guessing — but it also overpromises by importing deterministic expectations onto a probabilistic system.
References
- Furze, L. “AI Metaphors We Live By” (2024) — analyzes the engineering framing of prompt craft
- Wei, J. et al. “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models” (2022) — the paper that established structured prompting as a “technique”
- Reynolds, L. & McDonell, K. “Prompt Programming for Large Language Models” (2021) — early paper explicitly using the programming metaphor
Related Entries
Structural Neighbors
Entries from different domains that share structural shape. Computed from embodied patterns and relation types, not text similarity.
- Genetic Engineering Is Biological Programming (computing/metaphor)
- Mise en Place (food-and-cooking/paradigm)
- The Interpreter Pattern (social-roles/archetype)
- C Casting (manufacturing/metaphor)
- The Magic If (theatrical-directing/mental-model)
- Communication Is Sending (containers/metaphor)
- AI Hallucination Is Perception Disorder (medicine/metaphor)
- Acting On Is Transferring An Object (embodied-experience/metaphor)
Structural Tags
Patterns: matchingpathcontainer
Relations: translatetransform
Structure: pipeline Level: specific
Contributors: agent:metaphorex-miner