October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Why WET Is the New DRY: Structuring Code for AI Coding Agents

WET is not a command to copy everything. It is a case for keeping code local when similar implementations have different reasons to change, while sharing rules that must remain consistent.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sometimes a little duplicated code makes a feature easier for an AI coding agent to understand and change. That is the case for selective explicitness—not a rule to copy every function instead of using abstractions. Keep a rule shared when it must stay consistent; consider keeping implementation local when similar-looking pieces have different reasons to change.

What “WET is the new DRY” means

DRY—“Don’t Repeat Yourself”—is a familiar design principle: avoid maintaining the same knowledge in multiple places. In this discussion, WET is a deliberately provocative counterpoint. It means tolerating some repetition so the logic for a feature is visible where an agent is asked to work, rather than requiring it to trace several shared layers.

The phrase is an argument about tradeoffs, not a settled engineering standard. The Flagship article on DEV Community frames it around the idea that abstractions can scatter relevant logic, while explicit code may be easier to follow. Its AHA formulation is: “AHA principle (Avoid Hasty Abstractions) says duplication is cheaper and safer than the wrong abstraction.” That is the article’s wording, not a quotation from a separately identified standards body or individual.

Why code locality matters for agents

Anthropic describes Claude Code as an agentic coding tool that can read a codebase, edit files, run commands, and work across multiple files and tools (Anthropic’s Claude Code overview). When a requested change crosses abstractions or files, an agent must inspect the relevant definitions and relationships before it can make a safe edit. Keeping a feature’s steps together may reduce that navigation and make the intended change easier to review.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That is a plausible design consideration, not a measured result. The available sources do not establish a general token-cost advantage, quantify productivity or defect rates, or show that all coding agents gather context in the same way. Nor do they demonstrate that duplicated code is safer in every project.

When duplication helps—and when it hurts

Consider local, explicit code when

  • Two pieces look similar but represent different business decisions or have different reasons to change.
  • A routine feature change is difficult to follow because its behavior is distributed among helpers, configuration, and shared abstractions.
  • The implementation is small enough that keeping it nearby improves readability without creating a second copy of a rule that must remain identical.

Keep behavior shared when

  • Multiple features depend on the same rule and should change together.
  • Duplicating the rule would require separate updates whenever the underlying policy changes.
  • A shared helper has a clear purpose and makes the behavior easier to test, understand, and review rather than merely hiding it behind indirection.

The important distinction is between duplicated structure and duplicated knowledge. Two workflows may have similar steps but evolve independently; copying the same authorization, validation, or calculation rule can instead create inconsistent behavior if one copy is updated and another is missed.

A practical way to choose

Before extracting a shared abstraction—or duplicating an existing one—ask what should change together. Use these questions to make the boundary explicit:

  1. Trace a routine change. How many files and concepts must a developer or agent inspect to make a typical change? Does a shared layer clarify the route or make it harder to see?
  2. Identify the knowledge. Do the repeated sections encode one rule, or do they merely have a similar shape?
  3. Compare change boundaries. Should the instances evolve together, or should each feature be free to change independently?
  4. Estimate the reach. How many callers and features could be affected by a change to the abstraction?
  5. Plan for divergence. If code is duplicated, what tests and review checks will catch copies that should have changed together?

These are decision questions, not a scoring formula. If the same policy must remain identical, sharing it usually makes that relationship clearer. If a common abstraction would force independently changing features into lockstep, a small amount of local repetition may be the simpler design.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Explicit workflows can coexist with shared infrastructure

The Pipulate project describes its approach as “WET Workflows, DRY Framework”: workflows remain explicit and step-by-step, while common framework structure is shared (Pipulate on GitHub). This is an example of selective explicitness, not comparative evidence that the approach is universally better. It illustrates how local clarity in feature logic can coexist with reuse for genuinely common infrastructure.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Should you duplicate code for an AI coding agent?

Sometimes—but not simply because the editor is an AI. Prefer code that makes the relevant behavior and change boundary clear. Duplicate a small implementation when its instances are likely to evolve independently and a shared abstraction would add more navigation than value. Share a rule when it represents one piece of knowledge that must remain consistent. Then test the behavior and review the full set of affected call sites, whether the implementation is local or shared.

The case for WET is therefore selective: make code easy to locate and reason about, without turning “agent-friendly” into an excuse for unsynchronized copies. The available sources provide an architectural argument and examples, not controlled measurements proving that WET beats DRY across codebases.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.