July 29th, 2024

The Documentation Tradeoff

Kent Beck's article discusses the complexities of software documentation, emphasizing effective communication over excessive documentation. He critiques "self-documenting code" and the neo-waterfall approach, advocating for alternatives like discussions and tests.

Read original articleLink Icon
The Documentation Tradeoff

Kent Beck discusses the complexities of software documentation in his article "The Documentation Tradeoff." He emphasizes that while effective communication among programmers is essential, the push for increased documentation can lead to inefficiencies. Beck critiques the notion of "self-documenting code," arguing that it often serves as an excuse for programmers to avoid necessary communication. He warns against the neo-waterfall approach, which advocates for extensive upfront documentation and specifications, suggesting that this can result in outdated documents that do not align with the code.

Beck highlights the tradeoffs involved in documentation, noting that it should be justified based on factors such as audience size, stability of the information, and the cost of delaying other productive work. He suggests alternatives to traditional documentation, including simplifying code, socializing through discussions, and using tests as a means of communication. Ultimately, he encourages programmers to focus on clear communication rather than merely producing documentation for its own sake. Beck concludes by noting the irony of calls for more documentation coinciding with advancements in AI tools that can explain code, suggesting that the role of documentation may evolve as technology improves.

Related

Documentation Driven Development (2022)

Documentation Driven Development (2022)

Documentation Driven Development (DDD) is proposed as a more effective approach than Test-Driven Development (TDD) for software development. DDD involves starting with documentation to iron out implementation details before coding, helping to address API shifts and scope misunderstandings early on. By documenting requirements and potential future API changes, developers can better plan and refine their code, avoiding costly refactors later. DDD emphasizes the importance of various forms of documentation, including design mockups, API references, and tests, to communicate thoughts and guide development. This method encourages a feedback loop on APIs and work scope, enhancing code quality and project outcomes. DDD aligns with concepts like Behavioral Driven Development (BDD) and Acceptance Test-Driven Development (ATDD), emphasizing user behavior validation and strong communication practices. By incorporating DDD into their workflow, developers can improve collaboration, goal refinement, and code quality, leading to more successful project outcomes.

Self Documenting Code Is Bullshit

Self Documenting Code Is Bullshit

Klaus Breyer challenges self-documenting code, advocating for external documentation to enhance precision and abstraction. He emphasizes the need for detailed information like variable units and invariants, promoting a balanced approach for code clarity.

Docs as code (2017)

Docs as code (2017)

Documentation as Code (Docs as Code) aligns documentation creation with coding practices, emphasizing collaboration, integration with development, and tool consistency. Write the Docs community advocates this approach through talks, successful industry examples, recommended books, and an open-source toolchain for effective implementation.

Why We Build Simple Software

Why We Build Simple Software

Simplicity in software development, likened to a Toyota Corolla's reliability, is crucial. Emphasizing straightforward tools and reducing complexity enhances reliability. Prioritizing simplicity over unnecessary features offers better value and reliability.

My programming beliefs as of July 2024

My programming beliefs as of July 2024

Evan Hahn emphasizes tailored programming approaches, distinguishing "simple" from "easy," promoting testability through modularity, and advocating for ethical coding practices prioritizing societal impact and nuanced thinking in software development.

Link Icon 6 comments
By @creesch - 3 months
If I read the article correctly, it boils down to "if you communicate through enough other means, you will need less documentation". Which in theory I do agree with, the problem often enough is all other means of communication.

A lot of them are actually much harder to pull off than writing documentation. In a lot of organizations, it basically boils down to there being a few people that are seen as "knowledge holders" where everyone flocks to for their questions. These knowledge holders then get over asked, making it difficult for them to focus on their work. Which makes

> But don’t let anyone shame you into wasting time.

Work both ways as often a lack of documentation means a lot of people are actually wasting their time doing things that could have been solved with the right kind of documentation.

From the knowledge seeker's perspective, it is ridiculous to have to wait for someone to be available for half an hour to an hour if you can actually gain most knowledge from documents in half that time. Even if you eventually need to talk to someone, it greatly helps the conversation if your starting point isn't zero.

I agree that documentation doesn't have to be there in waterfall form. But the aim should be to have documentation and have that be a starting point for most people to gain knowledge about a subject within the organization.

As a last note

> Story-telling over lunch.

No, lunch is a break which means it is time for me, not the company.

By @hitchstory - 3 months
>I’ve been through this documentation story before. I can predict how it ends. By the time you read the documentation it’s out of sync with the code so you end up reading the code anyway. But then you feel bad, so you write more documentation & force yourself to update documentation whenever the code changes. But that takes time away from development & the pressure is on, so you stop writing/updating.

The story doesn't always end this way.

There are two types of documentation:

* Those that don't really go out of sync when you update the app - e.g. intros, overviews, contribution guidelines, justifications, etc.

* Those that can go out of date when you change the code - API references, how to guides, tutorials.

If the latter is autogenerated from tests + test metadata (how-to guides/tutorials) or from code (API references), it won't go out of date.

By @DarkNova6 - 3 months
I find it fascinating that the originator of TDD is so against this notion of documentation. Particularly since his methodology only works if you have well-defined up-front design.

But much more so than my grime of mixing principles and methodologies in the original TDD book is how he absolutely does not mention DDD. It strikes me that many programmers don't even attempt to understand a non-concrete, non-specific understanding of their programming and try to keep track of all data-flows in their mind. If your software grows at a non-trivial pace, this goes wrong every single-time (this is even the case for miracle programmers like John Carmack).

Good documentation allows to reason about your application in an abstract and formal way. It serves as an orthogonal layer of understanding. But you must talk with domain experts and do some serious knowledge crunching: Understand your domain, visualize your core concepts, write down important/complex processes etc. (aka, all the things pure coding-guys don't like).

And of course, maintain your domain understanding as much as you are maintaining code. "Code-only" doesn't scale, just as much as "Document waterfall" doesn't work.

Call me a DDD shill, but I seriously believe it is the way for non-trivial programs. Because you know what happens if you don't have a formal understanding of your program and you invest millions into your project? Games like Starfield happen.

By @irridiance - 3 months
I write a lot of documentation, knowing that it may be nobody else who reads it. Why? Because when I take the time to write clearly, I think clearly. It’s for my productivity and effectiveness, first.