Discussion on: Nobody Writes Clean Code. We All Just Pretend View post
stakiran profile image • Dec 1 ‘25
There are two meanings to “clean.”
One is “having low cognitive load,” and the other is “having low technical debt.” Therefore, instead of relying on the abstract concept of being clean, we should focus on reducing cognitive load or technical debt. Writing code that reduces these will make it clean.
…Though, of course, that’s easier said than done! Cognitive load can be reduced through a common language, which means we need to define that common language (this is precisely what domain-driven development is about). Technical debt, meanwhile, is the gap between the ideal and the implementation. Since the ideal, starting with the requirements, keeps “changing,” focusing solely on the implementation doesn’t hold much meaning.
Still, as an engineer, I believe we should strive to reduce these burdens as much as possible. The devil is in the details. There’s also the fable of the tortoise and the hare. By writing with the intention of reduction from the start, like in shift-left practices, we can avoid losing momentum later on.
sylwia-lask profile image • Dec 1 ‘25
Thank you for this incredibly thoughtful breakdown - I genuinely loved reading it. Your distinction between low cognitive load and low technical debt really resonates with me. I’ve felt that tension so many times in real projects, especially when requirements keep shifting and the “ideal” moves further away every week.
What you wrote about common language and reducing mental overhead is something I’ve seen play out in teams over and over again. When we’re not aligned on concepts, even the cleanest code becomes heavy. And when tech debt grows faster than features, even elegant solutions feel fragile.
That’s why I personally lean toward the simplest approach that reduces both the thinking burden and the future pain - even if it’s not perfect. It’s the only thing that consistently helps me stay sane through migrations, refactors, and constant change.
Really appreciate you taking the time to share this - it adds so much depth to the conversation.
christiecosky profile image • Mar 13
It’s nice to see another dev talking about cognitive load! I’ve spent the last two months writing about how writing code that is aligned with cognitive and perceptual principles are easier to read and maintain. When I started applying the SRP to my code more strictly, I was amazed to discover how much easier my code is to understand. With AI, I can ship maintainable, readable code extremely fast - it’s not one or the other anymore.
それそれ何と言っている?
ざっくり言うと、こういう話です。
「クリーンコード」って曖昧だけど、実は2つの意味があるよね、という話です。
なので、「cleanかどうか」をふわっと語るより、 認知負荷を減らす 技術的負債を減らす ことを目標にしたほうが実践的、という主張です。
さらに、
この人はかなり賛同しています。
要するに、
つまり、 完璧さより、今後の変更に耐えられて、頭にも優しいコードが大事 と言っています。
この人も「認知負荷」に注目していて共感しています。
ポイントは:
全体の流れを一言で言うと:
「クリーンコード」という曖昧な理想論より、
“人が理解しやすいか” と “将来つらくならないか” を重視しよう
という話です。
必要なら次に、