一盏灯
首页文章视频生词本复习
首页文章视频生词本我的

AI Assistants Now Write Most Boilerplate

AI 助手接管了样板代码:新闻速读

科技互联网新闻速读初级约 3 分钟场景 · ai boilerplate# AI 与自动化# 效率与方法

读完你能在团队里把『AI 写样板代码』这件事谈明白:三年间它从新鲜玩意变成日常,工程师写得更少、读得更多,新人练手的机会也随之减少。更实用的是最后一段给的说法——对着任务讲,交代自己委托了什么、检查了什么,而不是甩一句『AI 写的』。

当前浏览器暂不支持语音朗读

Boilerplate is the code nobody brags about. Config files, test scaffolding, the fortieth data class, the try-catch block around a network call. It is the part of the job that is necessary, repetitive, and completely unmemorable. Over the past three years, that work has quietly moved to the machine. Ask any engineer who has shipped something recently, and they will tell you the first draft of the dull parts now arrives written.

样板代码是没人拿出来炫耀的那种代码。配置文件、测试脚手架、第四十个数据类、包在网络请求外面的那个 try-catch。它是这份工作里必要、重复、且完全不值得记住的那一部分。过去三年里,这部分活儿悄悄挪到了机器身上。随便问一个最近发过版的工程师,他都会告诉你:枯燥那部分的初稿,现在送到手上时已经写好了。

The shift has a short history. GitHub Copilot opened as a technical preview in June 2021 and became generally available a year later. By 2023 the Stack Overflow developer survey had added a whole section on AI tools. On an Alphabet earnings call in October 2024, Sundar Pichai said that more than a quarter of all new code at Google was generated by AI and then reviewed by engineers. Three years, from novelty to normal.

这场转变的历史很短。GitHub Copilot 在 2021 年 6 月以技术预览的形式开放,一年后正式发布。到 2023 年,Stack Overflow 的开发者调研里已经专门辟出了 AI 工具的章节。2024 年 10 月的 Alphabet 财报电话会上,Sundar Pichai 说,谷歌超过四分之一的新代码由 AI 生成,再由工程师审阅。三年时间,从新鲜玩意变成了日常。

Why boilerplate first? Because it is the easiest thing in the world to predict. A model trained on public code has seen countless versions of the same pagination helper. The answer is not clever; it is average, and average is exactly what you want for a config file. The hard problems — the ones with a business rule hiding inside them — are still where humans earn their salary.

为什么最先被接管的是样板代码?因为它是这世上最容易被预测的东西。一个在公开代码上训练出来的模型,见过同一个分页工具函数的无数种写法。它给出的答案谈不上聪明,它给的是平均水平——而对一个配置文件来说,平均水平恰好就是你想要的。真正难的问题——那些里面藏着一条业务规则的问题——依然是人类挣工资的地方。

The day-to-day effect is not that engineers write less code. It is that they read more of it. A generated file looks finished before anyone has checked whether it is right. Teams that handle this well have added a small ritual: whoever opened the pull request has to walk through the generated parts and say which lines they actually understand. It sounds slow. It is faster than the alternative.

日常层面的变化,并不是工程师写的代码变少了,而是他们读的代码变多了。一个生成出来的文件,在任何人验证它对不对之前,看上去就已经像是完工了。处理得好的团队加了一个小仪式:提 PR 的那个人,得把生成的部分逐段过一遍,并说明哪几行是自己真正看懂的。听上去挺慢。但比另一种结局快。

There is an open worry about people starting out. Boilerplate used to be how you learned the shape of a codebase: you typed the same route handler twenty times and eventually stopped needing to look up the syntax. If the machine types it, where does that muscle come from? Nobody has a confident answer yet. The teams thinking hardest about it are giving each new hire a few deliberately tool-free weeks.

有一个没人回避的担心,是关于刚入行的人的。样板代码曾经是你摸清一个代码库长什么样的途径:同一个路由处理函数你敲上二十遍,最后就不用再去查语法了。如果这些活儿都由机器来敲,那份肌肉记忆从哪儿来?目前还没人给得出笃定的答案。在这件事上想得最认真的团队,会刻意给每个新人安排几周不用工具的时间。

The word itself is older than software. In the nineteenth century, boilerplate meant the steel plates used to build boilers; newspapers later borrowed it for ready-made text shipped to small papers as printing plates. The meaning has held for a hundred years: text you use without rewriting. It is fitting that the first job we handed to a language model was the one already named after mass production.

这个词本身比软件业还老。十九世纪时,boilerplate 指的是造锅炉用的钢板;后来报业借用了它,指那些做成印刷版、直接发给小报社照登的现成稿件。这个含义一百年没变过:你拿来直接用、不必重写的文字。把我们最先交给语言模型的活儿,恰恰是那件早就以量产命名的活儿——这挺合适。

So how do you bring up this topic with your team without sounding like a sales deck? Talk about the task, not the tool. "The migration script was generated, I reviewed it line by line, and I rewrote the date handling" tells your lead three useful things. "AI wrote it" tells them nothing they can act on. Say what you delegated, say what you checked, and own the result either way.

那么,你要怎么在团队里提起这个话题,才不像在念销售 PPT?对着任务说,别对着工具说。『那个迁移脚本是生成的,我逐行审过一遍,日期处理那块是我重写的』——这句话给了你主管三条有用的信息。而『AI 写的』什么信息也没给,他没法据此做任何事。讲清楚你把什么交了出去、你检查了什么,然后无论结果如何,自己认。