概念完整性与代码行数统计
英文标题:Conceptual integrity and counting lines of code
Simon Willison 在 Talking Postgres 播客中讨论了 AI 如何改变软件开发,并认为在使用编码 Agent 的背景下,代码行数有时仍可作为生产力提升的参考指标。传统情况下,工程师每天产出 50 至 60 行可上线代码已很常见,而 Agent 若能帮助产出 1000 行经过调试、可维护且经过测试的代码,则代表显著效率提升。与此同时,AI 降低功能开发成本也可能损害软件的“概念完整性”,使系统像不断扩建的温彻斯特神秘屋一样变得杂乱。对开发团队而言,新的瓶颈将更多转向认知容量、架构判断和工程纪律,而非单纯的代码生成速度。
中文
概念完整性与代码行数统计
2026 年 8 月 19 日
上周,我与 Claire Giordano 录制了 Talking Postgres 播客的一期节目,主题是“AI 如何改变软件开发”。我们的对话非常精彩。以下是经过轻微编辑的文字稿中的几段重点内容(给 Claude 的提示词是:“仅进行非常小的编辑,以删除口语停顿和赘词”)。
这是我一直试图构建的一项论点的最新版本:为什么在使用编码 Agent 时,讨论代码行数作为生产力指标有时确实是合理的。相关内容位于节目 35:01:
很多人会告诉你,用代码行数衡量生产力毫无意义。我其实不同意,因为这里存在一个硬性上限。在过去,一名软件工程师每天能产出几百行可投入生产环境的代码——而 200 行能正常工作、经过调试、达到生产级别的代码,已经是极其出色的一天了。大多数时候,你每天只能产出 50 或 60 行。
如果 Agent 能让你产出 1000 行经过调试的代码,这确实是非常有意义的提升——前提是代码质量相同:可维护、经过测试,以及具备所有这些特性。借助 Agent,你可以达到这一水平,但这需要大量的技能、知识和经验。这正是资深工程师的价值所在。
作为一名工程师,我现在能完成的工作比没有 Agent 时多得多。因此你可能会问:一家公司为什么还需要不止一名工程师?除了显而易见的“巴士因子”问题——单人团队是一个设计得非常糟糕的团队——答案在于,新的限制因素是认知容量。我可以以快 100 倍的速度产出代码,但我没有足够的认知容量去掌握 100 倍规模的代码。因此,你仍然需要一个工程师团队,以便在团队中对这种认知容量进行负载均衡。
还有节目 46:03 关于概念完整性的这段讨论,Claire 将其比作 温彻斯特神秘屋!
Simon:在 《人月神话》 中有一个概念,叫作“概念完整性”(conceptual integrity)。设计良好的软件具有一种完整性:其中没有意外,它恰好覆盖正确的问题领域,一切都能彼此契合并且合乎逻辑。对于编码 Agent 来说,这要困难得多:你可以想到一个功能,运行一条提示词,五分钟后这个功能就有了。你的软件会朝着各种奇怪的方向长出一些小突起。
Claire:你知道我对此的类比是什么吗?温彻斯特神秘屋。
Simon:它有 140 个房间,因为建造它的女性是温彻斯特步枪发明者的遗孀,而她的灵媒告诉她,除非她永远持续扩建这座房子,否则所有被那种步枪杀死的人的鬼魂都会纠缠她。于是,她在 40 年间不断添加新的房间。这正是编码 Agent 与软件面临的问题:持续添加新房间变得非常容易,因为增加这些房间的成本低得多。最终得到的东西会失去概念完整性——而后续也就更难对它作出决策。
一切最终都会回到纪律问题。过去,完成任务所需的时间会替你施加这种纪律约束。你想到一个疯狂的功能时,会觉得:“是啊,但那得花我一周时间——我无法为此辩护,所以还是算了。”如果只需要一个小时,就太容易为它找到合理性了。
(旁注:这篇 Wikipedia 文章引用了可靠来源,对上述灵媒故事提出了质疑。)
English / 原文
Conceptual integrity and counting lines of code
19th August 2026
Last week I recorded an episode of the Talking Postgres podcast with Claire Giordano on the subject of “How AI is changing software development”. We had a really great conversation. Here are a couple of my highlights from a lightly edited transcript (prompt to Claude: “very minor edits to remove disfluencies”).
This is the latest version of an argument I’ve been trying to build about why sometimes it does make sense to talk about lines of code as an indicator of productivity with coding agents, at 35:01:
A lot of people will tell you it makes no sense to measure productivity in lines of code. I’d actually disagree, because there’s a hard limit. In the before-times, a software engineer could produce a few hundred lines of production-ready code per day — and 200 lines of working, debugged, production-level code is an incredibly good day. Most days you’d produce 50 or 60.
If agents let you produce a thousand lines of debugged code, that really is a very meaningful improvement — as long as the code is the same quality: maintainable, tested, all of that. You can get to that point with agents, but it takes a huge amount of skill and knowledge and experience. That’s what senior engineers are made of.
I can do way more work as a single engineer than I could without agents. So you could argue, why should a company have more than one engineer? Beyond the obvious bus factor thing — a team of one is a very badly designed team — the answer is that the new limiting factor is cognitive capacity. I can churn out code a hundred times faster. I don’t have the cognitive capacity to stay on top of 100 times the amount of code. So you still need a team of engineers, so you can load balance that cognitive capacity across the team.
And this section on conceptual integrity at 46:03, which Claire equated to the Winchester Mystery House!
Simon : There’s a concept in The Mythical Man-Month — conceptual integrity — where well-designed software has an integrity to it: there are no surprises in it, it covers exactly the right domain of things, everything fits together and makes sense. That’s so much harder with coding agents, where you can have an idea for a feature, run a prompt, and five minuteslater you’ve got the feature. Your software grows little weird bumps in funny different directions.
Claire : You know my analogy for that? The Winchester Mystery House.
Simon : It’s got 140 rooms, because the woman who built it was the widow of the guy who invented the Winchester rifle, and her psychic told her she’d be haunted by the ghosts of everyone killed with that rifle unless she kept building the house forever. So for 40 years she kept adding new rooms. That’s exactly the problem with coding agents and software: it’s very easy to keep adding new rooms, because the cost of adding those rooms is so much cheaper. What you end up with is something where the conceptual integrity falls apart — and then it’s harder to make decisions about it.
It all keeps coming back to discipline. It used to be that the discipline was enforced on you by the amount of time it took. You’d come up with an idea for a crazy feature and think “yeah, but that would take me a week — I cannot justify that, so I’ll forget about it.” If it takes an hour, it’s so much easier to justify.
(Side-note: the Wikipedia article includes credible sources that dispute the story about the psychic.)