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 shared function, and referenced when needed. But the landscape of coding is actively shifting. We are…
The long-standing principle of DRY, or Don't Repeat Yourself, has long driven developers to structure their code with a focus on minimizing redundancy. However, as artificial intelligence systems like Agentic LLMs become more prevalent in coding, this approach is being reconsidered. These AI agents, such as Claude Code, Open Code, or Devin, are capable of planning, writing, and testing complete projects independently.
As a result, the so-called benefits of DRY architecture, which once made sense for human developers, are now seen as liabilities for AI-driven development. One of the key issues with DRY code is the token trap of deep abstractions. When an AI agent is tasked with modifying a codebase, it must sift through numerous files, loading all relevant information into its context window.
This requires a significant amount of tokens, consuming resources and slowing down the AI's ability to understand and make changes. In contrast, a WET architecture, which allows for some duplication of code, localizes the logic and reduces the cognitive load for AI agents. This approach minimizes the "typing penalty" that humans experience when writing repetitive code.
For AI agents, typing is virtually instantaneous and error-free, making WET architecture an efficient choice. Additionally, WET architecture helps prevent unintended consequences when AI agents make changes. With a highly abstracted DRY function, an AI might accidentally alter unrelated features that relied on that same abstraction.
However, WET architecture isolates components, allowing the AI to work independently and run its tests without triggering a large test suite across the entire application. This isolation provides the AI with the psychological safety to act autonomously, planning and executing changes with minimal risk. In conclusion, as AI agents become more capable of handling software development tasks, the WET architecture becomes increasingly advantageous.
It allows these powerful tools to operate at their full potential, providing efficient, safe, and autonomous software development. This shift towards WET architecture is reflected in Flagship's new AI-ready SaaS boilerplate, Flagship, which embraces the benefits of this approach, promising faster, safer, and more autonomous software creation.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.