好的代码终将胜出。
Good code will still win

原始链接: https://www.greptile.com/blog/ai-slopware-future

人工智能生成代码的激增引发了人们对大量低质量“垃圾代码”入侵软件开发的担忧。虽然有人预测人类编码的终结,并且数据显示代码复杂度及故障率都在上升,但Greptile认为经济激励最终会促使人工智能生成*高质量*代码。 目前,“蛮力”方法——快速生成和迭代——占据主导地位,导致代码库更大、更密集。然而,好的代码以简洁和清晰的设计为特征(如John Ousterhout所概述),从长远来看,维护和扩展成本更低。它需要的上下文更少,修改次数更少,最终,需要的计算资源也更少。 人工智能模型之间的竞争将有利于那些能够帮助开发者*最快*交付可靠功能的模型,这需要干净、易于维护的代码。虽然最初的重点是让人工智能代码*能够运行*,但市场最终会优先考虑效率和成本效益,迫使人工智能将质量置于数量之上。这种转变至关重要,因为软件复杂度持续上升,更简单的代码将是可持续发展的必要条件。

## 黑客新闻讨论:好的代码还会胜出吗? 一篇黑客新闻讨论,源于一个链接 (greptile.com),围绕着写得好的代码最终是否会胜出的问题展开。最初的帖子认为会,但评论者很快争论了“好”的定义——它是健壮的,还是仅仅*有用*且具有成本效益? 许多人认为,工程学通常优先考虑功能和可负担性,而不是寿命,并举例说明桥梁被建造得“勉强”能承受压力。 还有人指出罗马混凝土的历史例子,证明建造耐久品*是*可能的,但可能会以牺牲分配给其他需求的资源为代价。 对话还涉及了人工智能的影响。 一些人认为人工智能将使小型参与者能够竞争,而另一些人则认为它不会改变现有模式,即优先考虑上市速度而不是代码质量。 几位评论员挑战了先发优势总是获胜的观点,并举例说明谷歌超越了雅虎。 最后,关于随着越来越强大的人工智能模型,软件开发的未来出现了一场辩论。
相关文章

原文

A couple of years ago, "slop" became the popular shorthand for unwanted, mindlessly generated AI content flooding the internet including images, text, and spam. Simon Willison helped popularize the term, though it had been circulating in engineering communities in the years prior.

At Greptile, we spend a lot of time thinking about questions like: Is slop the future? Are programming best practices now a thing of the past? Will there be any reason at all for AI coding tools to write what we call good code going forward?

I want to argue that AI models will write good code because of economic incentives. Good code is cheaper to generate and maintain. Competition is high between the AI models right now, and the ones that win will help developers ship reliable features fastest, which requires simple, maintainable code. Good code will prevail, not only because we want it to (though we do!), but because economic forces demand it. Markets will not reward slop in coding, in the long-term.

Software development is changing fast. A prominent recent example comes from Ryan Dahl, creator of Node.js, who wrote, "The era of humans writing code is over. Disturbing for those of us who identify as SWEs, but no less true."

Meanwhile, the complexity of the average piece of software is drastically increasing. Theo [1] pointed out this trend. He notes that this increased complexity was driven partly by AI making it easier to ship more code faster, and partly by economic pressure for companies to keep up with competitors. Theo points out that the number of PRs are going up, which is what we've noticed at Greptile as well. As we covered in our State of AI Coding report [2], published a couple of months ago, lines of code per developer grew from 4,450 to 7,839 as AI coding tools became standard practice. Median PR size increased 33% from March to November 2025, rising from 57 to 76 lines changed. Individual file changes became 20% larger and "denser."

The stats suggest that devs are shipping more code with coding agents. The consequences may already be visible: analysis of vendor status pages [3] shows outages have steadily increased since 2022, suggesting software is becoming more brittle. Andrej Karpathy [4] describes: "agents bloat abstractions, have poor code aesthetics, are very prone to copy pasting code blocks and it's a mess, but at this point I stopped fighting it too hard and just moved on."

Collectively, software engineers are cranking out code at a high quantity. The approach driving much of this is brute force: generate code fast, iterate until it works, worry about simplicity and quality later (if at all).

In A Philosophy of Software Design [5], John Ousterhout argues that complexity is the #1 enemy of well-designed software. Bad code needs lots of context to understand. Good code is easy to understand, modify, and extend; it also hides implementation details, and creates deep modules with shallow interfaces. This simplicity also holds practical implications.

An idiot admires complexity, a genius admires simplicity

Good code requires upfront thinking about architecture, design, edge cases, and clean abstractions. By Ousterhout's definition, good code will also be easier to understand and modify, because it requires less context, which makes it dramatically cheaper overall. We don't actually know the exact trade-off yet, but for any software that lives longer than a weekend, it will be cheaper overall to generate good code.

By contrast, complex code doesn't scale. It requires a lot of tokens and compute, and as codebases grow, it gets exponentially more expensive.

Economic pressure will drive AI models to generate good code because getting the architecture right upfront is cheaper than fixing it later. That pressure is already changing what AI-powered development looks like. Good code needs less context to understand, fewer changes for maintenance, and therefore fewer input and output tokens over the life of the codebase.

We're still early in the AI coding adoption curve. As the technology matures, economic forces will drive AI models toward generating good, simpler, code because it will be cheaper overall.

The world right now is focused on getting AI to work in the first place, not on optimizing its abilities. We are going through a particularly messy phase of innovation. Once AI code generation becomes ubiquitous, I believe that economic incentives will start to take effect and AI models will be forced to generate good code to stay competitive amongst software developers and companies.


Reference

[1] Theo [2] State of AI Coding report [3] analysis of vendor status pages [4] Andrej Karpathy [5] A Philosophy of Software Design

联系我们 contact @ memedata.com