文章摘要
文章探讨了“Bus Factor”概念,即团队中掌握特定知识的人数,若这些人突然离开,项目将面临风险。历史上,人类通过多种方式避免Bus Factor降至1,如文档、培训和知识传递。然而,随着AI的发展,Bus Factor可能降至0,即知识完全由AI掌握,不再依赖人类。这引发了对知识传承和依赖AI的潜在风险的思考。
文章总结
标题:“AI优先”与“巴士系数”为零
主要内容:
“巴士系数”是一个衡量团队知识流失风险的概念,它通过估算团队中有多少人突然离开(例如被巴士撞到)后,项目将无法继续推进。例如,如果团队中有3个人知道如何恢复数据库备份,那么该功能的巴士系数为3。
历史上,巴士系数的最坏情况是1,即如果唯一掌握某项知识的人去世,知识就会丢失,除非之前已经传递出去。人类通过多种方式(如文档、视频教程、知识交接等)努力避免这种情况。
然而,2022年11月30日,随着ChatGPT的发布和生成式AI的普及,情况发生了根本变化。许多人开始接受巴士系数不仅为1,甚至为0的现状。这意味着,如果掌握知识的人离开,知识将完全丢失,因为AI生成的代码和知识并未被人类真正理解和掌握。
在编程领域,越来越多的行业倾向于让大型语言模型(LLM)生成函数、功能甚至整个项目,而不再深入理解代码库或保留相关知识。这种做法被称为“氛围编程”(vibe coding),它带来了严重的知识流失风险。
尽管LLM生成的代码质量可能存在问题,但更关键的是,团队在面对新代码库时,无法依赖传统的知识传递方式(如导师或文档),只能依赖自己对不完美系统生成代码的解码能力。这导致在修复漏洞、添加新功能或升级依赖时,团队可能完全不了解代码的构建方式和原因。
结论:
由于“氛围编程”导致巴士系数为零,这种做法存在根本性缺陷。除非未来出现能够100%准确生成代码并接收100%准确提示的AI,否则这种模式将难以持续。
如果你对“氛围编程”不感兴趣,可以阅读更多关于学习编程的建议文章。
评论总结
评论主要围绕AI生成代码的优缺点及其对软件开发的影响展开,观点多样且存在争议。以下是总结:
1. AI生成代码的潜在问题
- 缺乏解决方案的探讨:评论1指出,文章提出了AI生成代码的许多问题,但未探讨现有或潜在的解决方案。
引用:- "The article throws out a lot of potential issues with AI generated code, but doesn't stop for a moment to consider if solutions currently exist or might exist to these problems."
- "Does the author not think this can ever be solved?"
- 代码维护的挑战:评论8和评论21提到,未经审查的AI生成代码可能导致项目难以维护,尤其是在架构错误或复杂bug出现时。
引用:- "If you're using llms to shit out large swathes of unreviewed code your project is indeed doomed to become unmaintainable."
- "This just sounds like every other story I hear about working on ossified code bases as it is."
2. AI生成代码的优势
- 提高生产力:评论8和评论14认为,AI在特定场景下(如生成测试数据、文档或处理重复任务)能显著提高开发效率。
引用:- "Where llms excel is in situations like: I have
that I want to apply to - bam, half a days work done in 2 minutes." - "An LLM won't get annoyed at you if you ask it for thorough comments and updates to docs, READMEs, and ADRs."
- "Where llms excel is in situations like: I have
- 帮助理解复杂代码库:评论13和评论22指出,AI能帮助开发者快速理解不熟悉的代码库,并生成相关文档。
引用:- "LLMs make it vastly easier to work on unfamiliar code bases."
- "Using AI to cut through the noise and let the code explain itself felt like a net positive."
3. “Bus Factor”问题
- AI加剧知识流失:评论5和评论12认为,AI可能加速机构知识的流失,导致系统快速衰退。
引用:- "I fully expect a lot of these issues to come home to roost as AI compounds loss of institutional knowledge and leads to rapid system decay."
- "So while I agree that LLMs will accelerate this process, in my opinion it's not a new flavor, just more of an existing problem."
- AI并非唯一原因:评论9和评论18指出,“Bus Factor”问题在AI出现前就已存在,AI只是加剧了这一问题。
引用:- "This guy thinks bus factors of zero started with ChatGPT. Hahahahahaha. Adorable."
- "The Bus Factor was an issue long before LLM-generated code."
4. AI对程序员的影响
- 对技能的要求:评论20强调,AI工具仅对有经验的程序员有效,缺乏经验的程序员可能因依赖AI而变得更糟。
引用:- "LLMs are bad for bad programmers. LLMs will make a bad programmer worse and make a layperson think they're a prodigy."
- "You must already be a good programmer to use these tools effectively."
- 技能退化风险:评论16提到,过度依赖AI可能导致程序员技能退化,尤其是在部分自动化过程中。
引用:- "Your skills are atrophying. We see this all the time as engineers enter management, they become super competent at the new skills the role requires but quickly become pretty useless at solving technical problems."
5. 未来展望
- AI工具的潜力:评论3和评论14认为,随着AI工具的进步,未来可能通过更好的文档和结构解决代码维护问题。
引用:- "With the right guidance and structure an LLM-generated codebase might be easier to come into cold years later."
- "It's conceivable to me at least, that with the right guidance and structure an LLM-generated codebase might be easier to come into cold years later."
总结:评论者对AI生成代码的态度褒贬不一,认可其在提高效率和理解复杂代码方面的潜力,但也担忧其可能导致代码维护困难、知识流失和技能退化等问题。