We have to be thorough here, let's look for some boundary conditions, just one more test:

if input is negative, should return an error

Run tests... 🔴 test failed!

And there we go again...

Might seem a simple recipe but it breaks my defaults in two important ways:

First, writing tests before you write the code is not what I'm used to, but it's nothing compared with the...

Second, and more relevant to this post, writing crappy but effective code, then refactor. This approach blew my mind and gave me some insights about the psychology of creating things.