Simon Willison:代码行数仍是衡量 AI 编程生产力的有效指标
Conceptual integrity and counting lines of code
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").
上周,我与Claire Giordano一起录制了一期Talking Postgres播客,主题是“AI如何改变软件开发”。我们进行了一次非常精彩的对话。以下是我从经过轻微编辑的转录稿中提炼的几个亮点(提示给Claude:“仅做微小修改以去除不流畅之处”)。
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:
这是我一直在尝试构建的一个论点的最新版本,关于为什么在编码代理的背景下,有时谈论代码行数作为生产力指标是有意义的,见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.
很多人会告诉你,用代码行数来衡量生产力毫无意义。我实际上不同意,因为存在一个硬性限制。在过去,一名软件工程师每天能产出几百行可投入生产的代码——而200行经过调试、可运行、达到生产级别的代码,已经是极其出色的一天了。大多数日子里,你只能产出50或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!
还有这段关于概念完整性的讨论,在46:03处,Claire将其比作温彻斯特神秘屋!
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.
Simon:在《人月神话》中有一个概念——概念完整性——设计良好的软件具有一种完整性:其中没有意外,它恰好覆盖了正确的领域,所有部分都协调一致且合理。在使用编码代理时,这变得困难得多,因为你可以对某个功能有个想法,运行一个提示,五分钟后你就得到了这个功能。你的软件会以各种奇怪的方向长出小疙瘩。
Claire: You know my analogy for that? The Winchester Mystery House.
Claire:你知道我对这个的类比吗?温彻斯特神秘屋。
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.
西蒙:它有140个房间,因为建造它的女人是发明温彻斯特步枪那人的遗孀,她的通灵师告诉她,除非她永远不停地建造房子,否则她会被那把步枪杀死的人的鬼魂纠缠。所以在40年里,她不断增建新房间。这正是编码代理和软件的问题所在:很容易不断添加新房间,因为添加这些房间的成本要便宜得多。最终你得到的是概念完整性崩溃的东西——然后做决定就变得更难了。
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.)
(旁注:维基百科文章包含可信来源,对关于通灵师的故事提出质疑。)
Tags: ai, generative-ai, llms, podcast-appearances, coding-agents
标签:人工智能,生成式人工智能,大语言模型,播客露面,编码代理
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力