Hofstadter's Law

In a previous blog post I highlighted Murphy's law, which famously states "Everything that can go wrong, will". Today I will introduce you to Hofstadter's Law, another useful tool for programmers to keep in mind.

Hofstadter's law states:

It always takes longer than you expect, even when you take into account Hofstadter's Law.

If you have been a developer for a moderate amount of time, chances are good that you have discovered the difficult nature of estimating and scheduling software tasks. Our natural tendency seems to be to overestimate our ability complete complex tasks. We make plans and commit to schedules based on our own best-case scenarios: nothing will go wrong, we will not be distracted, and we will fly through our work like savant developers. To make matters worse, any attempt to add realism or failure contingencies to schedules is viewed as "sandbagging" by managers.

The difficulty in estimating our time is affected by many factors:

  • Pressure to agree to specific milestones from investors, customers, or management
  • Setting too many goals or planning in too much detail
  • Lack of focus (e.g. multitasking and continual context switching)
  • Failure to identify and complete the most important tasks (e.g. procrastination)
  • Failure to account for common/potential delays:
    • Illness
    • Vacations
    • Urgent meetings
    • Newly discovered problems
    • Shifting priorities
    • Upstream delays (e.g. in a manufacturing pipeline)
  • Failure to acknowledge a limited supply of resources to accomplish the mission

In a world that is very focused on getting things NOW, failing to meet a schedule usually produces extremely negative (and inappropriate) responses. I have witnessed developers and teams mutiny against schedules, estimates, and having project managers. If scheduling is unrealistic and only sets false expectations, why plan anything?

I warn you not to take Hofstadter's Law as an indication that planning is pointless. Simply keep the law in mind so you can set expectations accordingly. You will be late - add some slop to your estimates, and if you're unsure about a task add even more time. And don't be surprised when your project still runs over!

Just remember: It always takes longer than you expect, even when you take into account Hofstadter's Law.

Further Reading