Robert C. Martin——也就是全球开发者熟知的"Uncle Bob",《代码整洁之道》作者、敏捷开发宣言签署人之一——最近说了一句大实话。
在一次技术访谈中,这位编程界的教父级人物坦诚:他曾经完全相信AI能写出好代码,但现在不得不承认,这条路还没有走通。
这句话的分量,比十个AI编程工具的产品发布会加起来还重。因为Uncle Bob不是那种守旧的"AI怀疑论者"——恰恰相反,他是最早公开支持AI编程的业界大佬之一。他曾经说过"AI会让程序员的生产力提高10倍",他自己每天都在用Cursor和Copilot写代码。但现在,他说"还没走通"。
问题出在哪?
Uncle Bob的核心观察是:AI生成的代码,看起来对,但在结构、可维护性、长期可靠性上存在系统性问题。
第一,AI擅长"补全",不擅长"架构"。你让它写一个函数、实现一个接口、修一个bug,它做得很好,甚至比大多数初级程序员都快。但你让它设计一个干净、可扩展、符合SOLID原则的系统架构,它就开始力不从心了。它会堆功能、会复制粘贴、会用反模式解决眼前问题——就像一个只会加班赶工的初级开发,而不是一个有经验的架构师。
第二,AI生成的代码"读不懂"。这不是说代码复杂——恰恰相反,AI写的代码往往看起来很"干净"。但当你仔细去读,会发现它的逻辑是"拼"出来的,而不是"想"出来的。变量名可能很规范,注释可能很齐全,但代码背后没有一致的设计思想,没有贯穿始终的架构决策。你改一个地方,不知道会在哪里炸掉。
第三,也是最致命的:AI会非常自信地写出错误的代码。它不会说"我不知道",不会说"这个设计有问题",它只会给你一段看起来非常合理的代码,然后这段代码在某些边界条件下会以最出人意料的方式崩溃。这种"自信的错误"比明显的错误危险一百倍。
这不是唱空,是清醒
Uncle Bob的反思不是在说"AI编程没用"——恰恰相反,他每天都在用AI工具,他承认AI确实极大地提高了他的生产力。他的观点更微妙:AI是非常强大的编程助手,但它还不是程序员。
这个区别很重要。助手可以帮你查资料、写草稿、做重复劳动,但最终的判断、最终的设计决策、最终的质量责任,还是要由人来承担。如果你把AI当成"自动写代码的机器",完全信任它生成的每一行代码,那你迟早会踩大坑。
这和现在行业里的两种极端声音形成了鲜明对比。一种极端是"AI一年后就会取代所有程序员",贩卖焦虑;另一种极端是"AI写的代码全是垃圾",拒绝接受任何改变。Uncle Bob的立场在中间:AI是强大的工具,但工具需要人来驾驭。
对开发者来说,这意味着什么?意味着你更要懂代码了,而不是可以不用懂了。AI能帮你写代码,但你要能判断它写得对不对、好不好、有没有隐患。这要求你有比以前更强的代码审查能力、架构设计能力、问题排查能力。不会写代码的人,不可能用好AI写代码。
AI编程工具确实在变得越来越好,Cursor 2.5、Copilot、Claude Code这些产品的进步有目共睹。但"越来越好"和"已经走通"之间,还有很长的距离。承认这一点,不是悲观,是专业。
明天见。
Robert C. Martin — known to developers worldwide as "Uncle Bob," author of Clean Code and one of the signatories of the Agile Manifesto — recently said something blunt.
In a technical interview, the programming godfather acknowledged: he once fully believed AI could write good code, but now has to admit that path hasn't worked yet.
This statement carries more weight than ten AI coding tool launch keynotes combined. Because Uncle Bob isn't some Luddite "AI skeptic" — quite the opposite. He was one of the earliest industry heavyweights to publicly embrace AI coding. He once said AI would make programmers 10x more productive. He uses Cursor and Copilot daily. But now he says "it hasn't worked yet."
Where's the Problem?
Uncle Bob's core observation: AI-generated code looks right, but has systemic issues with structure, maintainability, and long-term reliability.
First, AI excels at "completion" but struggles with "architecture." Ask it to write a function, implement an interface, fix a bug — it does great, often faster than most junior developers. But ask it to design a clean, extensible system architecture that follows SOLID principles, and it starts to falter. It piles on features, copy-pastes, uses anti-patterns to solve immediate problems — like a junior dev cranking out overtime, not an experienced architect.
Second, AI-generated code is "unreadable." Not because it's complex — paradoxically, AI-written code often looks "clean." But when you read closely, you realize the logic is "assembled" rather than "thought through." Variable names may be standard, comments may be thorough, but there's no consistent design philosophy behind the code, no overarching architectural decision-making. Change one place, and you have no idea where it'll break.
Third, and most damning: AI writes incorrect code with great confidence. It doesn't say "I don't know." It doesn't say "this design has issues." It just gives you perfectly reasonable-looking code that fails in the most unexpected ways at certain edge cases. This kind of "confident error" is a hundred times more dangerous than an obvious mistake.
This Isn't Bearish — It's Sober
Uncle Bob's reflection isn't saying "AI coding is useless" — on the contrary, he uses AI tools daily and acknowledges they've massively boosted his productivity. His point is more nuanced: AI is a very powerful coding assistant, but it's not a programmer yet.
The distinction matters. An assistant can help you look things up, draft boilerplate, do repetitive work — but ultimate judgment, final design decisions, and quality responsibility still rest with the human. If you treat AI as an "automatic code-writing machine" and trust every line it generates, you will step on a landmine eventually.
This stands in sharp contrast to the two extreme voices in the industry today. One extreme says "AI will replace all programmers in a year" — selling panic. The other says "AI code is all garbage" — refusing to change. Uncle Bob's position is in the middle: AI is a powerful tool, but tools need skilled operators.
What does this mean for developers? It means you need to understand code more, not less. AI can write code for you, but you need to judge whether it's correct, good, and free of hidden pitfalls. This requires stronger code review skills, architectural thinking, and debugging abilities than before. People who can't write code won't be able to use AI to write code well.
AI coding tools are genuinely getting better — progress in Cursor 2.5, Copilot, and Claude Code is visible to anyone. But there's a long distance between "getting better" and "figured out." Acknowledging that isn't pessimism — it's professionalism.
See you tomorrow.
AI会写代码,但它不会负责——而负责,才是程序员这个职业真正的内核。
—— Dawn Vision编辑部
AI can write code, but it won't take responsibility — and responsibility is what being a programmer is really about.
— The Dawn Vision Editorial Desk
Uncle Bob · Clean Code · AI coding reflection · code quality · architecture design · programmer profession · agile development
Sources · 信源 Sources
本文基于 Dawn Vision 认知引擎处理的 4 个源信号生成,经编辑部人工审核。素材来源:InfoQ中文、技术访谈、Hacker News讨论。
This article was generated by the Dawn Vision cognitive engine processing 4 source signals, with human editorial review. Sources: InfoQ Chinese, tech interviews, Hacker News discussion.