| The Economic Benefit of Refactoring(martinfowler.com) | |
| 247 points by javaeeeee 21 hours ago | 107 comments | |
tl;dr: A developer refactored a 17,155-line Rust data access layer (in an agent-generated 150K LoC app) through 15 disciplined steps, running an experiment where a fresh sub-agent repeated the same feature-addition task after each step to measure token cost. Input tokens for the representative change dropped 83% (from ~160K to ~27K), primarily because the agent could identify and read smaller relevant subsets of code once files were properly decomposed. Output tokens barely changed, and Claude itself proved poor at both identifying and mechanically executing refactorings without human guidance. | |
HN Discussion:
| |