The Less It Remembers, the Less It Breaks

Most of my hardest bugs
weren’t really about logic.

They were about state.
Something stored, something stale,
something that changed when I wasn’t looking.

A function that just takes input and returns output
is easy to trust. I can hold it in my head.

One that quietly reaches out
and mutates the world
is a small landmine.

So I try to keep memory to a minimum.
Less stored. Less shared. Less hidden.

The less a piece of code remembers,
the fewer ways it can surprise me.

Simplicity, it turns out,
is mostly the absence of state.

– Serguey Asael Shinder

Leave a Reply