- Always lock doors from the outside using the key
- Always turn on the cold tap before the hot tap
However, I was mistaking the most likely outcome for the entire distribution. In Life's Grandeur, Stephen Jay Gould calls this "reification" - fixating on the average case and ignoring variation and atypical outcomes.
On any given occasion, my cavalier attitude would probably suffice. But sooner or later, if I locked doors by setting the snib and pulling them shut, my keys would not be in my pocket.
My parents understood my fallibility better than I did. And they were in a better position to appreciate the myriad of door-locking scenarios that would confront me over my lifetime.
That's why I like to think that if my mother were a programmer (and she'd make a good one) she would advocate TDD, which goes as follows:
- Write a failing test
- Write the minimum of code to pass the test
Be mindful of your development habits, and design them for the bad days, not the average days.