The dangerous knowledge
is the kind that lives only in your head.
"This list is always sorted."
"That's never null here."
"This runs before that."
True today.
Invisible to the next reader.
Gone from your own memory by winter.
Every implicit assumption
is a trap with your name on it.
So pull it into the open.
A type. A guard clause.
An assert. A name that says it.
Make the code state what you know,
so the compiler and the next human
don't have to guess.
Good code isn't clever.
It's honest about what it assumes.
Say the quiet part out loud —
in the code, where it can't be forgotten.
– Serguey Asael Shinder
Top comments (0)