Fail, fast

Adapted from an internal p2 post.

Fail-fast is a systems design approach that intentionally fails early and visibly. The gist is that it is better for users as well as better for developers to halt a system if it finds itself in a “critical enough” situation.

Wait, What, Why?

There are worse things than a crash.

Mike Stall (via Jeff Atwood) sketched an “app health hierarchy” which looks thusly:

1) Application works as expected and never crashes.
2) Application crashes due to rare bugs that nobody notices or cares about.
3) Application crashes due to a commonly encountered bug.
4) Application deadlocks and stops responding due to a common bug.
5) Application crashes long after the original bug.
6) Application causes data loss and/or corruption.

Complex systems can reduce their exposure to the darkest parts of that hierarchy in failing fast. Users are immediately presented truth rather than sometime later discovering their actions didn’t take. Developers get immediate, direct feedback in critical scenarios that points directly toward the root cause.

And, perhaps most importantly, halting in the right places prevents on-going corruption, which is what keeps me up at night as a software developer.

We can’t just BSOD our users!

Yes and no.

Yes, we can, if the situation is that critical and we know of no way to recover.

No, we can’t, on anything less than that.

Fail-fast requires (team) wisdom in implementation. Each situation must be considered in its own context. Tricky, at times, but in my experience the effort is very much worth it.

Thank You, Tim


We believe that privacy is a fundamental human right. No matter what country you live in, that right should be protected in keeping with four essential principles:

First, companies should challenge themselves to de-identify customer data or not collect that data in the first place.

Second, users should always know what data is being collected from them and what it’s being collected for. This is the only way to empower users to decide what collection is legitimate and what isn’t. Anything less is a sham.

Third, companies should recognize that data belongs to users and we should make it easy for people to get a copy of their personal data, as well as correct and delete it.

And fourth, everyone has a right to the security of their data. Security is at the heart of all data privacy and privacy rights.

Technology is capable of doing great things. But it doesn’t want to do great things. It doesn’t want anything. That part takes all of us. We are optimistic about technology’s awesome potential for good — but we know that it won’t happen on its own.

– Tim Cook, October 24, 2018

Joel Salatin Programming

…we respect and honor the pigness of the pig and the chickenness of the chicken.

Joel Salatin

Joel Salatin is an innovative farmer / agricultural philosopher(!) who has inspired me personally for quite some time. One of his farming tenets is respecting the inherent nature of the animals and the environment under his care. That resonates with me deeply. And I think it applies to programming.

We need to vigilantly avoid forcing logic against the grain of a language or its associated culture. Instead of asking “can I do this in language X?”, we need to be asking “should I do this in language X?” all along the way.

Because it’s never as simple as just writing logic a new way. Before writing that magical brilliant code in language X derived from paradigm Y, we need to ask ourselves questions like:

  • Does the logic mesh with the language’s natural expressivity?
  • What is the readability cost?
  • What are the context switching costs? Relative to rest of the project codebase? Relative to the rest of an organizational codebase?
  • What are the dev onboarding costs in deviating from community expectations?
  • Is the approach likely to be sustainable over time? Or will the magical library that makes it all possible flame out quickly?