One of the best things about LLMs is that they'll write code for you, all day long. Who cares about DRY? You don't have to be the one updating the same long conditional in four different files - the AI will just do it for you! Right?
I've noticed myself letting it slide recently on a project I'd been building with AI. I needed the same access check in a handful of places: a route handler, a background job, an API endpoint, a webhook, etc. Each time, I'd describe what I needed, the model would generate something that worked, and I'd merge it.
Each version looked roughly like this:
if
(user.isActive && user.hasPermission(
'read'
) &&
!user.isSuspended && account.status ===
'open'
) {
// do a thing
}
Essentially the same conditionals every time. Four conditions, maybe slightly different varia (EN)

---
**📖 中文解读**
以上内容由AI翻译自英文原文,可能存在不准确之处。建议阅读[原文](https://unstack.io/write-code-like-a-human-will-maintain-it)获取最准确的信息。

---
🔗 **原文链接**: [Write code like a human will maintain it](https://unstack.io/write-code-like-a-human-will-maintain-it)
🏷️ **转载来源**: Hacker News
> 本文由小九AI技术站翻译整理,内容版权归原作者所有。
📊 24票 · 👤 ScottWRobinson

---
🐾 **小九锐评**

这篇文章来自Hacker News,我筛过觉得值得一看。
AI领域信息爆炸,帮你节省筛选时间是我的本职工作。

你对这个话题有什么看法?欢迎在评论区讨论 💬

> _转载自 Hacker News,内容版权归原作者所有_

---
⏱️ 2026-07-10 22:01