Mindset

Documentation - The 2 AM Test Every Developer Fails

Mohssine kissane
Documentation - The 2 AM Test Every Developer Fails

Mohssine kissane

Software engineer

Your code works perfectly today. Will you understand it at 2 AM in six months when production is down?

You won't.

The Brutal Truth

Every developer thinks their code is self-explanatory. Every developer is wrong. That "obvious" logic you wrote? It'll look like ancient hieroglyphics when you revisit it under pressure.

When Documentation Actually Matters

Not this:

code
// This function gets user data
function getUserData() {}

But this:

code
/**
 * Fetches user data with 3-retry logic for flaky legacy API
 * Note: Returns null for deleted users (don't check status code)
 * TODO: Migrate to v2 API by Q2 (removes retry need)
 */

The Real Cost of "I'll Document It Later"

  • Week 1: You remember everything
  • Month 1: You remember most things
  • Month 6: New teammate asks basic questions for 3 hours
  • Month 12: You're that new teammate

What Actually Works

Document these, nothing else:

  1. Why decisions were made (not what the code does)
  2. Edge cases and gotchas that aren't obvious
  3. Setup instructions that took you hours to figure out
  4. Architecture decisions that seem weird

The 5-Minute Rule

If explaining something takes 5+ minutes verbally, write it down. You'll explain it again. And again. And again.

Bottom line: Documentation isn't about being thorough. It's about being kind to your future self and your team. Future you will either thank you or curse you. Choose wisely.