by kaycebasques · 3y ago · 0 comments
> In short, the 4doc model is not universal. It was designed for documenting tools and doesn’t fully address the needs of frameworks and programming languages.
I think that the author is onto something here, but I'm not sold on the exact example that the author provides (programming languages). Honest question: are the Python docs deeply loved by the Python community? In other words, should we be holding up the Python docs as an example of great docs and therefore an example that the 4doc model is inadequate? I've done a fair bit of Python programming myself. In my experience the Python docs are decent: not great, not terrible. If we look at the Rust docs, which seem to get much more praise than the Python docs, then the author's argument seems to break down for me a bit. Because the Rust docs seem to be more aligned with the 4doc model than the Python docs, and the Rust docs are more praised than the Python docs.
One domain where I recently saw the limitations of the 4doc model is OS bringup. I was writing docs explaining how to get an OS running on new hardware. Customer feedback suggested that the ideal doc would start off as an overview, and then morph into a guide, but the guide section would also need constant small explanations of conceptual stuff.
I also agree with the "it's not comprehensive" premise but again the example fell flat for me. Conceptual overviews totally overlap with explanations. I can elaborate if needed but I honestly think the author is imposing a narrow definition of explanations that does not exist in the 4doc model.
The main instances where the 4doc model is glaringly incomplete for me are homepages and release notes. You can kinda bucket homepages under explanations or references. And you can kinda bucket release notes under references. But those classifications are a stretch. The fact that practically every technical project needs a homepage and most need release notes really suggests to me that they are their own categories and deserve unique guidelines.
The key here would be to go back to goal-focused thinking. My guess for the #1 reason for 4doc's success is how it aligns each doc type with a goal:
* Tutorials - Learning
* How-To Guides - Tasks
* Explanations - Understanding
* References - Information
If you're going to propose a new universal doc type, you should be able to propose a new universal goal type as well. My argument about release notes begins to fall short here: release notes are totally about information so they should probably just get bucketed cleanly under references. But I think my argument about homepages holds its ground better:
* Homepages - Convincing
MAYBE (but probably not) we can save release notes like this:
* Release Notes - Diffing
The Pigweed docs might be an interesting example of where the 4doc model falls short. Here in SEED-0102 (our docs plan) you can see how the 4doc model is the foundation but we felt the need to define further categories of docs. In terms of domains (recall how the author suggested the 4doc is good for tools but not programming languages) Pigweed is a collection of a bunch of stuff for embedded development (libraries, tools, etc.) so that could explain why we needed to define more doc types. https://pigweed.dev/seed/0102-module-docs.html
The topic of examples came up recently on the Write The Docs Slack. Daniele Procida had a very thoughtful response. Original comment from Rob H:
> I tend to like to categorize some of my items by whether or not they have "examples," which seems to be an attribute that could apply to multiple diataxis types, but not a standalone type by itself. I could use a tag on these items with the word "examples," but I feel almost like it needs a category by itself, given that it seems to be my learning style. But then there's another twist: in some cases, an "example" is more of an "inspiration for a way to use something," and in others, an "example" is more of a "clarifier that completes the learning process."
Response from Procida:
> You can and probably should use examples everywhere. I think that a well-crafted example can often illuminate something much better than a painstaking attempt to describe it fully and completely. In every aspect of life in fact. I bet that you can think of someone who was an example to you, of say moral righteousness, that taught and inspired you more than any amount of moral theorising and argument (I certainly can). Examples are very powerful, and we are intelligent, so we use them very well when we encounter them. Examples illustrate extremely effectively, whether they are illustrating how-to guides, explanation, or whatever. But examples on their own seem a bit deracinated. What are they examples of? Don’t they need context?
4doc's contribution here is to ask you who the audience is for your release notes. Is it task-oriented, e.g. release notes for a database to help DBAs upgrade to that new version? Then write your release notes in a how-to style. Is it understanding-oriented, e.g. release notes for new B2C product features, to help users understand what it is you built? Then write your release notes in an explanation style. Different products have different requirements from their release notes, but 4doc helps you conceptualize who is supposed to benefit from it and therefore what style (and organization, and delivery) will be most beneficial when writing them.
The worst release notes are auto-generated from Git commits, in projects where Git commit messages are basically jotted-down handwritten chicken-scratch that are not really intended nor edited for external consumption. 4doc points out to you that autogenerating the release notes from commit messages like that is basically beneficial to nobody.
I can't speak to the Python docs. Sadly, it seems that Mozilla has lost the recording of me in 2013 laying out my vision for Rust's docs, which is what became reality.
I had never heard of the four-document model, but instead presented a "three document model":
* Tutorials: long form documentation that explained concepts. This became The Book, but pre that, there were a number of ~5 page tutorials on various things.
* Language Reference: specific documentation that's closer to a specification
* API Documentation: documentation per module, function, whatever specific unit, unconnected to other stuff.
I had come to understand documentation in this way based on my time with Ruby and Rails. Tutorials are Rails Guides. Reference is a language spec (of which Ruby doesn't really have one but I thought that was pretty sad). API documentation is rubydoc.
Eventually, "tutorials" kinda morphed into "the bookshelf," thanks to mdbook.
I think the main benefit of 4-doc model is that it makes you think about use cases for documentation. I think what you're alluding to is that there are more use cases.
The "release notes" serve the "I want to get overview of what changed" use case. The "homepage" serves the "I want to get a quick overview of the thing and see if I can use it" use case.
It's not clear though how the model could be extended to accomodate the above.
Tutorials, how-to guides, reference, explanation are modes of documentation.
They are not an exhaustive list of every kind of content that should appear in your documentation.
Diátaxis is not a list of four boxes into which all content should be mercilessly shoved whether it fits or not.
Consider: a homepage, an introduction, a foreword, a contents page, a landing page for a section, an index, credits, a list of contributors (I am sure you can think of more).
These can all be important. Documentation without a homepage would be positively stupid. I don't think we should have sections that are not introduced by landing pages.
Diátaxis doesn't prescribe anything for them, not because they are not important, but because they are not themselves modes of documentation. They are part of its furniture, if you like - just as an introduction, translator's note etc might be an important part of a book, but nothing whatsoever to do with the story it contains.
Homepages and landing pages are explicitly mentioned at https://diataxis.fr/complex-hierarchies/, by the way.
(Release notes could equally well be expressed as reference or in a section on their own. It really doesn't matter. It doesn't seem like something Diátaxis needs to worry about.)
The most common reasons I check the docs are because I want to know all the functions available for an object, or what type of parameters a function expects, or what a function returns. None of these are straightforward in the Python docs, and you often have to read several paragraphs of text that may or may not have the answer.
Here's one example: https://docs.python.org/3/library/urllib.request.html#module...
What type is cafile supposed to be? You have to ctrl-f or read a bunch to find out that it doesn't even say. I guess you're supposed to assume it's a string from the context (or is it some kind of File object?). If you work primarily in Python and you're familiar with the conventions this might be obvious, but if you're not a frequent Python user and don't immediately remember if there's a special Path type or not, this is annoying.
What does that function return? There are three paragraphs describing the potential return types in the middle of a very long docstring, they aren't highlighted in any way even though this is pretty fundamental information, and they aren't comprehensive. I might need to click a couple links to figure out what exactly this function is giving me.
Here's another example: https://docs.python.org/3/library/datetime.html#datetime.dat...
Is timestamp a string or a number? Again you're just supposed to already know the Python conventions, or go do trial-and-error in the REPL.
These issues are pervasive for me on docs.python.org - it always feels way too verbose while lacking basic details. Every time I visit a page I wish there were a simple quick reference table at the top listing all the functions and their types before it dives into the minutiae.
I'm (maybe this goes without saying) a big fan of the Python docs. They make simple things easy by covering the 80% use cases really well, and for the rest they link source code up at the top. Django does this too which I really appreciate. I think you generally learn to use the affordances of the internet and browsers (cafile site:docs.python.org, ctrl+f) with all websites like, I mostly don't want websites reimplementing that stuff--usually worse--for me.
I would contrast it with the Python gRPC docs [0] which are a lot more type-savvy but don't really very much context about what the methods and such do. Like I've read [1] about 4 times and I don't understand it any better than after the 1st read.
IDK all I'm saying is there's more to it than just type information. Communicating technical information to people is really involved.
* There's a bit of a "have your cake and eat it too" problem with Diataxis. The key underlying idea of Diataxis is that it represents modes of documentation, not concrete doc types. In that regard it's super counterproductive for us to discuss Diataxis as "the 4doc model". But on the other hand Diataxis does map each mode of documentation to a concrete doc type (Learning => Tutorial, Task => How-To Guide, Information => Reference, Understanding => Explanation) so I think it's understandable for people to conflate the two. Also, to make Diataxis useful, you have to be able to translate the ideas to the real world quickly. My impression at the moment is that Diataxis might be a little too abstract and it's causing us to have discussions where we just keep circling around the same ideas and arguing about definitions rather than actually having conversations that lead to documentation innovation.
* The article brings up a great point that Divio was initially billed as the grand unified theory of documentation, but Diataxis has moved away from that phrasing. Based on how Diataxis deals with modes of documentation I do think that it's essentially still attempting to be an attempt at a grand unified theory. And that's a good thing! Most of us agree that it's a useful foundation. The main questions in my mind are these: 1) are there any other modes out there? 2) is learning/tasks/understanding/information the most useful way to think about the fundamental modes? The main research approach for figuring out these questions is to look at real docs in the wild and then contemplate how they relate to modes.
I find this table helpful to understand the four types model: https://diataxis.fr/compass/ This makes two distinctions: step-by-step vs. knowledge, and studying vs. working. The names given to each of the four categories are not the main point in my opinion.
If we accept that categorization, then the offical Python tutorial is in the knowledge/studying quadrant IMO, so actually not a "tutorial", but an "explanation"! Which makes complete sense to me, you need an explanation to work with a programming language, and actually defangs most of the criticism in the article. See for yourself, it's not step-by-step at all, instead, you get very small code examples among a sea of explanatory text: https://docs.python.org/3/tutorial/
So, yeah, words are used differently by different people.
I get your categorization and agree with it but honestly... the world would be a much better place if we could collectively be more consistent with the labeling of our docs:
* Users would find the docs they need faster because they know that the content of the "tutorial" really does line up with the usual definition of tutorial.
* We would make more progress on documentation innovation because we would spend less time clarifying miscommunications like this.
It's not going to happen, of course, but a man can dream
There aren't only 4 general document types, there are others, and you don't always need the 4 ones either.
Anyway, I'd say release notes are for upgrading.
My intuition says that the critiques of "it isn't universal" and "it isn't comprehensive" have merit but without stronger examples it's hard to tell.
But maybe the whole topic is moot because, as the post says, it was only Divio that claimed that this was the grand unifying theory of documentation. If Diataxis has distanced itself from this claim then there is no longer a need for it to be universal or comprehensive.
> There aren't only 4 general document types, there are others
The Diataxis author replied elsewhere in this thread reminding me that he thinks of them as modes of documentation. Which is different than doc types. The main idea in my mind is that there are other important modes of documentation that are not covered by learning, tasks, understanding, or information. That's what I was trying to work out in my comment about homepages and release notes. They seem to represent new modes.