The Overrated Best Practice: Why 'Clean Code' Can Be a Trap
Every junior dev is told to write "clean code" first. But after years in the trenches, I've seen this advice burn out more engineers than it helps.
The Cult of Clean Code
Don't get me wrong—readable, maintainable code is important. The problem isn't clean code itself. It's the way we've turned it into a religion.
I've watched engineers spend three days refactoring a function that works perfectly fine because it wasn't "clean enough." I've seen teams delay launches because someone decided the codebase needed to be restructured first.
Meanwhile, the competitor shipped.
What Clean Code Actually Costs
Time: Every hour spent making code "cleaner" is an hour not spent building features or fixing bugs.
Consistency: Different developers have different definitions of "clean." What one person considers elegant, another sees as over-engineered.
Paralysis: The pursuit of perfection can prevent shipping. "I'll clean this up before merging" becomes "I'll rewrite this entire module."
A Better Approach
Here's what I tell junior developers now:
1. Working code beats clean code. Ship it first. Refactor when you have real data about what matters.
2. Clean code is a tool, not a goal. Use it when it helps. Ignore it when it doesn't.
3. The best code is code that doesn't need to exist. Before writing anything, ask: can I solve this with less code? Can I delete something?
4. Optimize for understanding, not aesthetics. A slightly "ugly" function with good comments beats a beautiful abstraction that nobody can follow.
The Real Skill
The best engineers I know aren't the ones who write the cleanest code. They're the ones who know when clean code matters and when it doesn't.
Sometimes you need a beautifully architected system. Sometimes you need a hacky script that solves the problem right now.
Knowing the difference? That's the real skill.