logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·01.11.26
← Back to news

Write code like a human will maintain it

Original article
unstack.io|243 points|202 comments|by ScottWRobinson|Jul 10, 2026

Write Code as if a Human Still Needs to Maintain It

By Scott Robinson · July 10, 2026

One of the most intoxicating aspects of Large Language Models (LLMs) is their willingness to churn out code indefinitely. The tedious work—like updating a sprawling conditional statement across four separate files—is no longer your burden; the AI handles it in seconds.

Recently, while working on an AI-assisted project, I caught myself slipping into a dangerous habit. I required a specific access validation check in several distinct areas:

  • Route handlers
  • Background jobs
  • API endpoints
  • Webhooks

Each time I needed the check, I described the requirement, the model produced a working snippet, and I merged it. The resulting code looked something like this:

if (user.isActive && user.hasPermission('read') && !user.isSuspended && account.status === 'open') {
    // Execute the logic
}

The Trap of "AI-Driven" Laziness

I ended up with four nearly identical blocks of logic. While the variable names shifted slightly, the core logic was copy-pasted. In a traditional workflow, I would have extracted this into a shared helper function. However, because the tests passed and I didn't expect to touch the code again, I let it slide.

I fell into a specific mental trap: "I'll refactor this later" →\rightarrow→ "Why bother with best practices if the AI is the one maintaining it?"

I believed I was outsourcing the pain of maintenance to the machine. I was wrong.

The Feedback Loop of Technical Debt

LLMs do not operate in a vacuum; they rely on the context of your open files, existing patterns, and recent commits. Every shortcut you merge acts as a signal to the model about the "standard" for your project.

ApproachActionLong-term Result
Human-CentricExtract shared logic →\rightarrow→ DRYMaintainable, clean codebase
AI-LazyMerge duplicates →\rightarrow→ WETCompounding technical debt

When I asked for a fifth endpoint, the LLM didn't return to first principles. Instead, it looked at the four existing copies in the repo and concluded: "This is how we write access checks here."

The Cycle of Decay

The Cost of Signaling

If you continue this cycle, the "bad pattern" ceases to be an anomaly and becomes your defined style. You can no longer trust the LLM to fix these issues globally because it has been trained to believe the duplication is intentional.

The mathematical probability of the AI introducing a bug increases as the noise in the codebase grows: P(Error)∝Number of Duplicated PatternsP(\text{Error}) \propto \text{Number of Duplicated Patterns}P(Error)∝Number of Duplicated Patterns

The epiphany: I thought I was delegating maintenance, but I was actually training my assistant to develop progressively worse habits.

Final Checklist for AI Collaboration

  • Did I extract repeated logic into a helper?
  • Am I merging a "quick fix" that signals a bad pattern?
  • Would a human be able to maintain this without an LLM?

LLMs are essentially sponges; they soak up your habits and reflect them back at you. If you feed them sloppiness, they will return it with interest.


Stay Curious: Follow along for monthly insights on the intersection of software engineering and curiosity.

AI Maintenance Concept