Sometimes the shiny new hammer isn't the right tool. A developer going by thedolceway on DEV.to published a case study this week detailing how they ripped out an LLM call and replaced it with roughly 200 lines of template code — and the result was simpler, faster, and more reliable.
The Problem: A Letter Generator
The feature in question was a recommendation letter generator. Users fill in a few fields — presumably recipient name, applicant details, context — and receive a finished letter. The obvious modern approach would be to construct a prompt and call an AI model. That's what many developers would reach for instinctively.
Why Templates Won
But thedolceway identified two critical constraints that made template logic superior. First, the output is short with a fixed structure: a date block at the top, a greeting, three or four paragraphs of body text, and a sign-off. No creative freedom required — just variable interpolation into predetermined slots.
The Deterministic Advantage
Second, recommendation letters are inherently deterministic documents. There's no ambiguity to resolve, no tone to interpret, no edge cases requiring judgment. A template simply plugs user input into the right place and renders the result. No risk of the model hallucinating a qualification or going off-script with unexpected phrasing.
When This Approach Makes Sense
This isn't an argument that AI is bad — it's a reminder that software engineering still rewards picking the right tool for the job. Structured outputs with fixed schemas, high-volume low-variance generation, and anything requiring strict compliance formatting are all candidates where traditional code can outperform LLM calls in predictability and cost.
Key Takeaways
- Fixed output structure + deterministic requirements = template territory
- LLM overhead (latency, cost, variability) isn't always justified
- 200 lines of straightforward code beats prompt engineering for well-defined tasks
- The "just use AI" reflex deserves scrutiny on every project
The Bottom Line
The AI-everywhere mindset needs a reality check. When your output has a fixed shape and zero tolerance for surprises, deterministic code isn't just adequate — it's superior. Template logic deserves more respect in the age of generative AI.