Why Documentation is a Myth (and Other Fairy Tales)

May 7, 2023

7 min read

đź‘€ 93

Ah, documentation—the legendary unicorn of the software engineering world. A beacon of hope and light, meant to guide us through the murky waters of someone else’s code. In theory, it’s supposed to explain everything: how to set up the project, what each function does, how to troubleshoot when everything inevitably breaks. In reality, good documentation is as rare as a developer who actually wants to write it. Let’s face it: documentation is a myth, a tale told to junior developers to keep their spirits high. So, let's dive into the wonderful, mystical world of documentation myths, why they persist, and why they are, in all likelihood, fairy tales.

1. The Myth of the Perfectly Documented Project

Once upon a time, there was a perfectly documented project. Every function was explained, every module had clear usage examples, and the README file was as long as a novel but as clear as a sunny day. New developers joined the team, followed the instructions, and everything worked perfectly on the first try. Senior developers spent their time on complex issues rather than answering repetitive questions.

And then you woke up.

The truth is, perfect documentation is a myth because nobody has the time or motivation to write it. Who wants to explain what a function does when they could be writing more code or, better yet, closing their laptop and heading out for the day? Documentation is always someone else’s job, usually the next person to join the team, which leads to…

2. The Myth of “I will Document It Later”

This is a classic tale, passed down from one generation of developers to the next. “I’ll document it later,” we say, with the optimism of someone who genuinely believes that they will remember what they were doing after lunch. Later becomes tomorrow, which becomes next week, which becomes never. The problem is, by the time “later” comes around, nobody remembers what that piece of code was supposed to do in the first place. It’s like writing a post-it note to yourself but forgetting where you left the note. This leads to the inevitable comment: // TODO: explain this.

Spoiler alert: nobody will ever explain it.

3. The Myth of “Self-Documenting Code”

“Good code doesn’t need documentation; it’s self-documenting.” If you’ve heard this, you’re not alone. It’s the software engineer’s version of “the dog ate my homework.” In an ideal world, code should be so clear and well-written that its purpose is self-evident. However, in the real world, where code is written under tight deadlines, modified by multiple developers, and written at 2 a.m. after three Red Bulls, “self-documenting” is just an excuse to not write comments.

We’ve all seen function a(x) with no comments, no context, and a variable name that could mean literally anything. Sure, the original author might have known what it did, but now it’s just a relic, sitting there like an ancient artifact that nobody dares touch.

4. The Myth of the “Documentation Driven Development”

Ah, DDD—Documentation Driven Development. The idea that you’ll write the documentation first, outlining how the code should behave, and then write the code to match it. It’s a beautiful concept, one that prioritizes clarity and understanding over everything else. The problem? It’s boring as hell.

No developer worth their salt wants to write documentation before they write code. They want to jump in, experiment, try things out, and see what breaks. Writing documentation before you write the code is like writing the assembly instructions for a piece of IKEA furniture before you know what it looks like. You end up with a bunch of mismatched parts and an Allen wrench, wondering why you have three screws left over.

5. The Myth of the “One True Format”

There’s always a debate about the best way to document a project. Should you use Markdown? Inline comments? Auto-generated docs from tools like Javadoc or Sphinx? Every team, every developer, and every project has a different answer. The truth is, there is no “one true format.” And even if there were, it wouldn’t solve the problem because the real issue isn’t the format—it’s the motivation to write the damn thing in the first place.

Formats are just the tip of the iceberg. What matters is consistency and clarity. But when everyone has their own style and no one has the time to enforce guidelines, you end up with a Frankenstein’s monster of documentation that’s half Markdown, half inline comments, and half indecipherable notes in someone’s personal notebook.

6. The Myth of “Comprehensive Documentation”

Let’s talk about the idea that documentation can be “comprehensive.” This is the promise that every aspect of the project will be covered, from the high-level architecture down to the nitty-gritty implementation details. In reality, comprehensive documentation is just another word for “unfinished.” Sure, someone might start out with the intention of documenting everything, but as the project evolves, the documentation lags behind. Features change, bugs are fixed, and code is refactored, but the documentation? It’s stuck in time, reflecting a past that no longer exists.

Comprehensive documentation is like a time capsule, perfectly preserving the state of a project at one moment in history. But time moves on, and what was once accurate is now misleading, causing more confusion than it solves.

7. The Myth of “Everyone Will Contribute”

“Don’t worry,” they say, “everyone will contribute to the documentation.” It’s a nice idea, that the whole team will pitch in, ensuring that everything is covered. But let’s be honest—when was the last time you saw someone volunteer to write documentation? It’s like trying to get someone to do the dishes at a party. Everyone nods in agreement that it’s important, but when it comes time to actually do it, everyone suddenly remembers they have somewhere else to be.

Documentation is usually left to the newest member of the team or the person who made the mistake of mentioning that they enjoy writing. Even then, contributions are sporadic, and the quality is hit or miss.

Conclusion: The Reality of Documentation

Documentation, like the unicorn, is a beautiful idea—majestic and elusive. In the real world, it’s often incomplete, out of date, or simply non-existent. So what’s the solution? Instead of chasing the mythical beast of perfect documentation, aim for something achievable: clarity, consistency, and regular updates. Accept that documentation will never be perfect and that’s okay. Make it a habit, not an afterthought. Encourage small, frequent updates rather than waiting for the mythical day when someone has “enough time” to do it right.

And remember, at the end of the day, sometimes the best documentation is just a conversation. So, don’t be afraid to ask questions. After all, even the best fairy tales need storytellers.