Why WET is the New DRY: Structuring code for Agentic LLMs
The problem with DRY For decades, developers have been used to write code following a DRY paradigm: Don't Repeat Yourself. This project structure is drilled into the minds of web developers since their first youtube tutorial: every piece of code you need more than once, should be exported to a sha

The problem with DRY For decades, developers have been used to write code following a DRY paradigm: Don't Repeat Yourself. This project structure is drilled into the minds of web developers since their first youtube tutorial: every piece of code you need more than once, should be exported to a shared function, and referenced when needed. But the landscape of coding is actively shifting. We are moving from human keystrokes to relying on Agentic LLMs, dynamic AI systems like Claude Code, Open Code or Devin, that plan, write and test full projects. As these AI agents become our collaborators, DRY architecture is becoming a liability. Instead, WET (Write Everything Twice, or Write Every Time) is being reconsidered as the best way to structure projects for AI-driven development. Here is why having a project full of duplicate code, might not be as bad as they brought us to think. Agentic AI writes code differently when compared to human devs. When an agent tackles a task, it loads all the relevant files into his context window, works out the logic, and execute changes based on a continuous loop of observation and reflection. In a hyper DRY codebase, every problem is solved using lots of small solutions, scattered among lots of files, meaning an AI Agent, to understand the codebase and perform an edit we might see as simple, needs to sift, fetch and keep all these files loaded in working memory, consuming tens of thousands of tokens just in tool calls and file reads. WET architecture keeps logic localized by allowing some duplication, so all the context an AI needs to understand to reach an objective lives there, drastically decreasing cognitive load and API cost, as well as preventing the AI from wandering around dependencies and forgetting the original goal. Historically, WET code was interpreted as "We Enjoy Typing" or "Waste Everyone's Time" in a mocking way. For a human developer, that is absolutely correct, writing the same code five times over is tedious, boring and prone to syntax errors. For an AI on the other hand, typing is instantaneous and flawless. The physical cost of WET architecture dropped to zero. AI excels at generating boilerplate, pattern-matching, and scaffolding out full files in seconds. When the primary friction of WET architecture the manual labor of typing is removed by an LLM, we are free to focus on the concept we want to build, and how to prompt it. One of the biggest risks of using autonomous AI agents is unintended consequences. When an agent edits a highly abstracted, shared DRY function to fix a bug for some feature, it risks accidentally breaking 3 other features that relied on that same abstraction. WET architecture isolates components. AHA principle (Avoid Hasty Abstractions) says duplication is cheaper and safer than the wrong abstraction. The AI can confidently rewrite the localized code, run its tests, and verify success, without needing to trigger a huge test suite across the entire application to ensure it didn't break a shared utility. This isolation gives the agent the psychological safety to act autonomously. It can plan and execute freely with the blast radius of its changes is confined to a single component. TLDR Hyper optimized, DRY code was built for human limitations: our slow typing speeds and our need for a single source of truth to hold in our limited biological memory. AI agents just don't have these bottlenecks. They thrive on clear context, isolated blast radiuses, and linear logic. WET architecture means our AI tools get used to their full capabilities, it means providing them with the exact environment they thrive in, it means cheaper costs, it means local LLMs that can actually, finally build fast, safe, and autonomous software. And that, is the reason we chose WET architecture for our AI-ready SaaS boilerplate, Flagship. So have fun tinkering with Agentic AIs knowing about these advantages, and give us feedback about the outcome! Flagship signing off.
Key Takeaways
- โขThe problem with DRY For decades, developers have been used to write code following a DRY paradigm: Don't Repeat Yourself
- โขThis story was reported by Dev.to, covering developments in the dev space.
- โขAI advancements continue to reshape industries โ read the full article on Dev.to for complete coverage.
๐ Continue reading the full article:
Read Full Article on Dev.to โShare this article



