The peril of laziness lost

原始链接: https://bcantrill.dtrace.org/2026/04/12/the-peril-of-laziness-lost/

Larry Wall,《编程Perl》的作者,将懒惰、急躁和傲慢定义为良好软件设计的核心美德。编程中的真正“懒惰”并非逃避工作,而是努力追求优雅、强大的抽象,以最大限度地减少未来的工作量——这是一项具有欺骗性的艰巨任务。它指的是构建足够简单以易于维护和扩展的系统。 然而,大型语言模型(LLM)提供的现成代码生成,威胁着这一原则。LLM不同于人类程序员,它们不会感受到复杂性的代价,也不会重视未来的时间节省。这导致了臃肿、低效的代码——例如,项目包含多个测试框架和冗余文件,并且生成速度惊人。 作者认为,LLM放大了以数量而非质量为中心的“程序员”文化。虽然LLM是宝贵的*工具*,但它们缺乏源于人类约束的简化内在动力。最终,维护真正优秀的软件需要我们自身的“美德懒惰”——一种致力于简洁、设计良好的系统的承诺,这不仅对当前的开发人员有益,而且对所有后续者都有益。

一个黑客新闻的讨论围绕代码抽象和重复之间的平衡。原始帖子链接到dtrace.org,引发了关于何时优先考虑抽象的对话。 一位评论员suzzer99认为,现代开发通常*需要*更多的抽象,这与较早的建议形成对比,例如“Programming Perl”中鼓励避免过早抽象——提倡在创建新的抽象之前采用“WET”(重复编写代码)的方法。 另一位用户gnerd00分享了类似的经历,回忆起早期Perl开发的复杂性以及Larry Wall的建议当时如何引起共鸣。他们将过去的经验与当前AI驱动的代码生成格局联系起来,发现这次讨论现在尤其重要。本质上,这个帖子强调了对抽象思维的转变,表明过度抽象与抽象不足一样,都可能存在问题。
相关文章

原文

In his classic Programming Perl — affectionately known to a generation of technologists as "the Camel Book" — Larry Wall famously wrote of the three virtues of a programmer as laziness, impatience, and hubris:

If we’re going to talk about good software design, we have to talk about Laziness, Impatience, and Hubris, the basis of good software design. We’ve all fallen into the trap of using cut-and-paste when we should have defined a higher-level abstraction, if only just a loop or subroutine. To be sure, some folks have gone to the opposite extreme of defining ever-growing mounds of higher level abstractions when they should have used cut-and-paste. Generally, though, most of us need to think about using more abstraction rather than less.

Of these virtues, I have always found laziness to be the most profound: packed within its tongue-in-cheek self-deprecation is a commentary on not just the need for abstraction, but the aesthetics of it. Laziness drives us to make the system as simple as possible (but no simpler!) — to develop the powerful abstractions that then allow us to do much more, much more easily.

Of course, the implicit wink here is that it takes a lot of work to be lazy: when programmers are engaged in the seeming laziness of hammock-driven development, we are in fact turning the problem over and over in our heads. We undertake the hard intellectual work of developing these abstractions in part because we are optimizing the hypothetical time of our future selves, even if at the expense of our current one. When we get this calculus right, it is glorious, as the abstraction serves not just ourselves, but all who come after us. That is, our laziness serves to make software easier to write, and systems easier to compose — to allow more people to write more of it.

Ideally, you would want those that benefit from abstractions to pay the virtue of laziness forward — to use their new-found power to themselves labor on the abstractions they make. But a consequence of the broadening of software creation over the past two decades is it includes more and more people who are unlikely to call themselves programmers — and for whom the virtue of laziness would lose its intended meaning.

Worse, the extraordinary productivity allowed by modern abstractions has given rise to an emphasis on a kind of false industriousness. Pejoratively, this was the rise of the brogrammer, with the virtue of ironic laziness and hammock-driven development displaced by hustle porn about crushing code.

Onto this dry tinder has struck the lightning bolt of LLMs. Whatever one’s disposition is to software creation, LLMs allow that to be applied with (much) greater force, so it should be of little surprise that LLMs have served as anabolic steroids for the brogrammer set.

Elated with their new-found bulk, they can’t seem to shut up about it. Take, for example, brogrammer-of-note Garry Tan, who has been particularly insufferable about his LLM use, bragging about his rate of thirty-seven thousand lines of code per day (and "still speeding up"):

If laziness is a virtue of a programmer, thinking about software this way is clearly a vice. And like assessing literature by the pound, its fallacy is clear even to novice programmers.

As for the artifact that Tan was building with such frenetic energy, I was broadly ignoring it. Polish software engineer Gregorein, however, took it apart, and the results are at once predictable, hilarious and instructive: A single load of Tan’s "newsletter-blog-thingy" included multiple test harnesses (!), the Hello World Rails app (?!), a stowaway text editor, and then eight different variants of the same logo — one of which with zero bytes.

The problem here isn’t these issues per se (which are all fixable!), and it isn’t even the belief that the methodology that created them represents the future of software engineering (though that is certainly annoying!).

The problem is that LLMs inherently lack the virtue of laziness. Work costs nothing to an LLM. LLMs do not feel a need to optimize for their own (or anyone’s) future time, and will happily dump more and more onto a layercake of garbage. Left unchecked, LLMs will make systems larger, not better — appealing to perverse vanity metrics, perhaps, but at the cost of everything that matters. As such, LLMs highlight how essential our human laziness is: our finite time forces us to develop crisp abstractions in part because we don’t want to waste our (human!) time on the consequences of clunky ones. The best engineering is always borne of constraints, and the constraint of our time places limits on the cognitive load of the system that we’re willing to accept. This is what drives us to make the system simpler, despite its essential complexity. As I expanded on in my talk The Complexity of Simplicity, this is a significant undertaking — and we cannot expect LLMs that do not operate under constraints of time or load to undertake it of their own volition.

This is not to say, of course, that LLMs won’t play an important role in our future: they are an extraordinary tool for software engineering, but — as outlined in our guidelines for LLM use at Oxide — they are but a tool. We can put them to use tackling the non-ironic (and non-virtuous!) aspects of programmer laziness — helping us take on thorny problems like technical debt —  or use them to promote our engineering rigor, but it must be in service of our own virtuous laziness: to yield a simpler, more powerful system that serves not just ourselves, but the generations of software engineers to come after us.

联系我们 contact @ memedata.com