Menu
Dev.to #architecture·September 21, 2026

WET vs. DRY Architecture in the Age of Agentic LLMs

This article explores how the rise of agentic Large Language Models (LLMs) is challenging the long-standing DRY (Don't Repeat Yourself) principle in software architecture. It proposes that WET (Write Everything Twice/Every Time) architecture might be more suitable for AI-driven development by providing localized context, reducing token consumption, minimizing blast radius for changes, and leveraging AI's ability to generate boilerplate efficiently. This paradigm shift encourages re-evaluating architectural patterns in light of new AI development workflows.

Read original on Dev.to #architecture

Shifting Paradigms: DRY vs. WET for AI Agents

Traditionally, the DRY (Don't Repeat Yourself) principle has been a cornerstone of software development, advocating for shared functions and minimal code duplication to enhance maintainability, reduce bugs, and improve readability for human developers. However, the emergence of agentic LLMs (e.g., Claude Code, Devin) as active code collaborators necessitates a re-evaluation of this principle. These AI agents interact with code differently than humans, leading to arguments for a shift towards WET (Write Everything Twice/Every Time) architecture.

The "Token Trap" and Context Management

Agentic LLMs operate by loading relevant files into a context window to understand the codebase and execute changes. In a highly DRY codebase, where logic is fragmented across many small, interdependent files, an AI agent must fetch and retain numerous files in its working memory. This process consumes significant computational resources in terms of tokens and API calls, leading to what the article calls the "token trap." By contrast, WET architecture localizes logic, keeping all necessary context for an objective within a single, or a few, files. This drastically reduces the cognitive load for the AI, minimizes token consumption, and prevents the AI from losing focus on its primary goal while navigating dependencies.

Minimizing the AI's "Blast Radius"

A significant risk with autonomous AI agents is unintended consequences. When an AI modifies a highly abstracted, shared DRY function to fix one bug, it risks introducing regressions in other parts of the system that rely on that same abstraction. This concept is often referred to as a large "blast radius."

💡

AHA Principle

The AHA (Avoid Hasty Abstractions) principle suggests that duplication is often cheaper and safer than premature or incorrect abstractions. This aligns well with the WET approach for AI-driven development, where the cost of duplication is near zero for an AI.

WET architecture, by design, isolates components through deliberate duplication. This allows the AI to make changes with greater confidence, knowing that the potential impact of its modifications is confined to a localized area. The agent can then run targeted tests and verify success without needing to trigger extensive test suites across the entire application, enhancing both speed and safety of AI-driven development. This isolation provides "psychological safety" for autonomous agents to act freely.

Trade-offs and Implications for System Design

While WET architecture for AI-ready systems addresses the limitations of LLMs (token context, typing speed, blast radius), it introduces new considerations for human developers. Tools and workflows must evolve to manage duplication effectively. The article posits that DRY was built for human limitations, whereas WET leverages AI's strengths like instantaneous, flawless code generation and pattern matching. Architects designing systems intended for significant AI collaboration should consider these trade-offs, focusing on how code structure facilitates efficient AI interaction and minimizes operational costs.

AI developmentLLMsarchitecture principlesDRYWETcode organizationagentic AIsoftware design

Comments

Loading comments...