Linus Torvalds harshly criticized a pull request for adding a helper function that made code less readable, not more. His main point? Code should be obvious and self-contained, not abstracted to the point of confusion.
“If you write
(a << 16) + b, you know what it does. If you writemake_u32_from_two_u16(a, b), you don’t.”
Duplication isn’t always bad.
Repeating simple logic can reduce mental overhead.
Abstracting everything into helpers increases “micro-context switches.”
Every helper function, file jump, or abstraction costs brainpower.
Humans and LLMs have limited working memory — fewer “chunks” = better clarity.
Keep related logic close together.
Easier for humans and AI tools to understand and refactor.
With modern IDEs and LLMs, refactoring is cheap.
Don’t abstract early — optimize for clarity first.
Linus’s technical critique was valid, but his delivery was harsh.
The author reminds us: “It doesn’t cost anything to be nice.”
Clean code isn’t just about elegance — it’s about reducing friction for future readers. Sometimes, repeating yourself is the kindest thing you can do for your teammates (and your future self).
0
6
1