April 4, 2026

Ghosts in code, bots take the blame

Functional programming accellerates agentic feature development

Devs say the fix isn’t smarter bots—just clean code without hidden ghosts

TLDR: The article says AI coding agents fail because our code hides surprises; functional programming makes code predictable. Commenters fought over solutions: strict testing, Clojure-style purity, or skeptics asking why switch now. It matters because clearer code could turn AI from demo magic into dependable tools.

The post lit up the dev crowd by claiming AI coding agents don’t fail because they’re dumb—they fail because our codebases are haunted by hidden settings and surprise database calls. The author’s cure? Old-school functional programming: write “pure” functions that don’t secretly change stuff, keep side-effects (like saving files) at the edges, and make data flow obvious. Cue the comment drama: “It’s not the model, it’s the code.” Some cheered, some rolled eyes, and one camp brought snacks and receipts.

Skeptics like midnight_eclair weren’t buying vibes: they want a formal way to describe boundaries and generate deterministic tests—no more trust falls with bots. The TDD (test-driven development) crowd chimed in—pmarreck says strict testing rules help agents behave. Then the Clojure crew arrived, declaring this whole vision “basically Clojure,” no math wizardry needed, sparking a mini flame war over which language gets to say “we told you so.” Meanwhile, pragmatists like Tadeuvich asked the money question: if functional programming was so good, why hasn’t everyone switched? And yes, someone dropped the classic “GPT-5 will fix it” meme while others waved an MIT stat saying most AI pilots flop. The mood: half exorcism, half reunion tour, with one-liners like “close” throwing gasoline on the thread.

Key Points

  • The article attributes agent-related production failures to architectural issues—hidden state and side effects in mutable, tightly coupled codebases—rather than model quality.
  • An example shows a function with hidden dependencies on global config and a database singleton that passes tests but fails in production.
  • Agents lack persistent context and rely on explicit contracts, making implicit dependencies and side effects especially risky.
  • The author references an MIT finding that 95% of AI pilots fail to deliver ROI, aligning with observed degradation and rollbacks.
  • Functional programming principles—pure functions, explicit data flow, and isolating side effects at boundaries—are presented as the remedy to make codebases agent-friendly.

Hottest takes

"no amount of markdown prompting is going to increase my confidence" — midnight_eclair
"so does insisting on TDD." — pmarreck
"This article is just describing Clojure" — lispisok
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.