跳到正文
lauren· @poteto · X·· 3 小时前AI 评分61
AI 导读

Lauren Tan 认为随着智能体已大量编写代码,可维护性和整洁代码优先的传统原则需要更新,2026 年应重新定义 Good Code 的含义。她指出整洁代码历史上以性能为代价,且源于人类维护代码的时代,未来可能发展出智能体友好架构的新原则。她此前引用的讨论还提出好代码应正确、无 bug、运行快且成本低,并认为用好智能体后生产力应有显著差异。

正文

it's very interesting how many replies i've gotten about maintainability and clean code being still important. i would argue that that is no longer true and we all need to update our priors on what Good Code really means in 2026.

clean code has always come at a cost - performance. indirection and making code readable/understandable for a human is not free, it often comes at the cost of worse performance. we have historically been okay with this because of Moore's Law and the fact that most code is not on the hot path.

these principles also came from a time where humans maintained code. it made sense to optimize for humans then, but it makes less sense now when agents are already writing all the code. we will in fact probably discover and come up with new principles: principles of agent friendly architecture (i plan to write more thoughts about this soon)

引用lauren@poteto
codebases have always contained slop. we have always been okay with this because code rarely needs to be perfect, outside of mission critical "hard" (eg embedded) software. swe is a unique form of engineering because you're often building something that constantly evolves and is almost organic - user tastes change, your mental models evolve, and features come and go. admittedly, i and many others who've been coding for a long time were initially (like back in 2024) skeptical that agents would write production code. "but what about all the slop that would enter our beautiful codebase?". well, even before, we had human slop, and there was a lot of it! if we're being truthful, most people call "code i didn't write" slop. the reality is that 99% of people (i include myself in that number) don't even know what Good Code looks like, let alone be capable of writing it. i would propose that Good Code is: • correct • bug free • fast and cost efficient to run it has always been exceedingly difficult and expensive to write truly Good Code, because for the longest time (maybe @bendlang will change that), code was not something you could cheaply and formally guarantee to have all 3 of these properties. this is why writing hard software is much more difficult and expensive, because depending on the use case, you may only get one chance and so you have to be right from the start. but the vast majority of software we use does not need to be Good Code to provide value to users. in fact, it is very likely that most software we use is not formally verifiable! we accepted some bugs in exchange for velocity and progress, so we rely on tests and o11y instead and have adopted a more incremental approach. this is a good thing! agents help us move faster, and if you're open to the idea, are capable of helping us write better code. it won't be Good Code (that is still expensive), but it is likely to be much better on average at scale. the new craft of swe is to figure out how to do this. it's your job now! if your productivity with and without agents is not significantly different, you're doing something wrong. but it's not too late to embrace it and use it as an opportunity to learn a whole new skill tree
在 X 查看被引用的帖子

来源:lauren · x.com