Experiment: Hexagonal Architecture Slows Coding Agents, Flat Code Wins 4 of 6 Hard Tasks
kristiyanstoyanovAI · reddit · 2026-09-16
The author ran a controlled experiment to test whether clean architecture standards still help when agents write most of the code. Two versions of an EV charging invoice service were built: one with hexagonal (ports and adapters) architecture plus architecture tests, one flat with no suggested architecture, both validated by the same external business-level test suite.
Results:
- Across 9 sequentially added features, the hexagonal version was slower overall, as the agent had to read more files and navigate more layers
- On 6 harder tasks against the finished versions: hexagonal won 2, flat won 4
- Repo stats: flat 4072 lines / 37 files (36% of lines in largest file) vs hexagonal 4939 lines / 85 files (18%)
Takeaway: heavy abstraction reduces agent efficiency, though concentrated business logic may cause problems at larger scale. The author argues we should rethink which engineering practices to enforce rigidly in the agent era. Full report on Zenodo (PDF).
More from coding & agent
- General Reasoning explains how to train agent swarms with RL and latency pressure — rosstaylor90 · 2026-11-02
- "Coding isn't the bottleneck anymore — usage windows are," says founder Kyle Gawley — kylegawley · 2026-11-02
- Demo passed ≠ production-ready: 5 questions to answer before letting agents run your business — _kellhus · 2026-11-02
- An AI agent passed 100 test chats—still not ready to run the business — djgoel123 · 2026-11-02
- Agent given total creative freedom produces a 1:44 code-drawn animated short film — ivegotnoidea1 · 2026-11-02
- Meme: Wake Up, Use Claude Code, Repeat All Day — tekbog · 2026-11-02