Must and Must Not: On writing documentation
queue.acm.org
queue.acm.org
Your job is to write concisely, using simple, unambiguous language that's quick to read and easy to digest. It's a skill that must be learned, practiced, and honed.
It's also a good idea to explicitly spell out the meanings of "must not" etc, because people (especially non-native speakers) sometimes get confused. Example: https://github.com/kstenerud/concise-encoding/blob/master/cb...
It doesn't take up much room, but it saves a whole lot of trouble down the line.
We got up to 600 pages for a spec one time. And we could only do that because our intern figured out a trick to keep the text editor from panicking on that much text (edit chapters, concatenate them only to produce the final doc).
We got a nasty architectural surprise one day because the same paragraph appeared, ver batim, more than 40 times (I think it may have been as many as 60) in different sections of the document.
But one of them was worded slightly different from the others in the middle of the paragraph, negating some assumptions we had made about the information architecture of the system. I was pretty upset by this. What a hostile way to write documentation! It felt like sabotage.
To stop this happening again I wanted us to move clauses like this high up in the document and instead of repeating them, using one sentence to refer to the common constraint elsewhere. Then the difference would have stuck out like a sore thumb, and might not have been accepted. Unfortunately they weren't biting. As a consequence, document review got a lot slower after that incident.
One of my bosses at a previous job was a shockingly open and pragmatic person. On several occasions he stated that something we were planning to do was a trick you only get to use once, and did we really want to spend that trick on this particular issue or save it for something more important. This documentation trick felt cheap and poorly spent.
Agree completely. Can you recommend any resources that emphasize this point and provide similar helpful documentation guidelines?
The cool thing about text is, that it can be many things to many people and this is even more true with hyperlinks. Try to cover all bases at least a little bit and people will ignore the stuff they dislike and go after the stuff they like.
- Don't Repeat Yourself: Describe it in one place, and then refer to it elsewhere in the document.
- Componentize: Build up smaller concepts and then use those smaller concepts to build up bigger concepts, etc. Then you can continue to use simple language with the bigger concepts that are easily broken down because they in turn are described in full.
- Each part does one thing and does it well. Don't mix many different concepts in one description. Describe one thing well, and reference it elsewhere.
- Keep things short. The longer a section is, the harder it is to absorb.
- Naming is important. Use memorable, descriptive names for your concepts.
- Have examples that demonstrate your concepts. Don't try to pack many concepts into a single example; that just makes it harder to figure out.
- Have a glossary if there are more than 10 new concepts.
- Test your documentation on people who are unfamiliar with the project. Ask them where they're getting confused. Confusion is the human manifestation of a bug in your documentation.
- Always keep your goal in mind. What should the end result be with your reader? Anything taking longer than 10 minutes is a chore, and only the most dedicated would continue that far.
- U/X is important. UI layouts, source code, and documentation all have U/X components to them because a human will be interacting with them / consuming them in some form. Make it easy for them to navigate to what they need.
• On Writing Well[1], by the inimitable William Zinsser
• Clear and Simple as the Truth[2], by Thomas and Turner
I've written some more about the above two books here[3], in a different thread.
[1] https://www.goodreads.com/author/show/7881675.William_Zinsse...
Of course, these guides are only helpful if you already understand what you're trying to convey; that's the real secret of writing well. Figuring out the correct sequence to walk a reader from "I don't know anything about this topic" to "I understand this topic" is more art than science, and to do so well takes years of practice.
[1]: https://plainlanguage.gov/resources/checklists/checklist/
https://xkcd.com/simplewriter/
I keep the words that truly add value to the project, and replace all the others with more simple ways of saying whatever I am trying to say. Usually in the process I lose a few lines of text (occasionally I can a few bullet points instead). It's a pretty good experience to go through (for example, this post fails. A lot.)
Chapter 1: What is this thesis about?
p1: What is the problem tackled in this thesis?
p2: Has there been previous work done on the problem?
p3: Can the previous work be improved?
Chapter 2: How did I approach the problem?
and so on.
Then the writer started answering the questions. The final step (usually) is to change the questions into headings or remove them.
To be fair, the two clauses of this sentence are somewhat confusing: If it is "OK to wait" it somehow implies that "you don't have to", while "must not" is indeed imperative.
Man I wish the JavaScript community would grasp this better. I’m looking at you, GitBooks!
This is a pretty common attitude, but I would argue that you are not a competent engineer unless you can properly document what you have done, plan to do, expect of other systems, etc.
It may not be a favorite part of the job, but it absolutely is a critical and fundamental part of the job.
Also, writing documentations helps me understanding and reflect.
It’s the why vs what issue scaled back a layer. With software and systems you want the user to do solve many problems with your solution, but you never let them know your exact intent and that causes shoehorning.
But other than that, it seems like a terrible response to the question asked, missing the point of the original question by at least 80%. Or phrased another way, it sounds like somebody's trying to push for RFC 2119 and sacrifices giving good answers to questions.
I'd use these:
X shall Y: X always does Y.
X shall not Y: X never does Y.
X should Y: it is expected that X will do Y, but it might not often enough that this case needs to be handled (as opposed to an "X shall Y" not doing Y which would be considered to total failure of the system).
X should not Y: it is expected that X will not do Y, but if it does you should handle it.
X may Y: both X does Y and X does not do Y are OK.
Wondering whether that is common response or not.
"X may not do Y." as a statement implies that X doing Y is unusual, but possible.
"X may not do Y." as a command implies that X doing Y is a mistake.
This [0] was imo an excellent discussion on documentation that gets to the issue much more than word and formatting choices.
The short is there isn’t “documentation” as one thing, but four.
1. Tutorials where you start to finish explain it to a newbie,
2. How to guides where you explain specific tasks,
3. Discussions where you lose all formal pretext and explain your INTENT (huge) and reasoning for decisions, like you would actually explain to a person, not a robot, not some cute marketing talk
4. Technical reference that goes over the actual mechanics and the weeds that people need only once they’re working with your solution.
It was on HN at least once. [0] https://www.divio.com/blog/documentation/
"Must not do ...": Disallowed / prohibited.
Do A, B, C. Don't do X, Y, Z.
Am I the only person who thinks it's ironic that an article about documentation appears to suffer from a fairly fundamental ambiguity?
"Need not" (or "May...") indicate actions or behaviours which are allowed or optional. This is not the same as "do X", which is a "MUST" condition.
"Must not" (or "Don't...") indicate actions or behaviours which are expressly disallowed.
RFC 2119 referenced in the article should make all this clear. If you're still confused after reading that ... you SHOULD NOT be writing documentation. And possibly not be reading it ;-)
int *i, j;
i is a pointer to an int, j is an int. The * binds to the variable identifier, not to the type. Famously troublesome for beginners.One of my current favorites is Ismo's use of "ass" as seen on Conan: https://youtu.be/HLyFlWahuSE
2. MUST NOT This phrase, or the phrase "SHALL NOT", mean that the definition is an absolute prohibition of the specification.
This makes the authors point about citation. In technical documentation any terms use like this must (MUST) be defined, either in line or by citation.
This is also part of the reason they are capitalized, to key you to the fact they are being used in a structurally important way. If you are reading them, you need to familiarize yourself with the context.
We used "shall" and avoided "not". Because testing: how do you prove a "not"?
Source: 35 years of SE
Agree "not" is tougher, and best avoided when you can.
The reason you do it this way is that it's way easier to write bullets that it is to write sentences. It allows you to focus on substance instead of form. It's analogous to typing into a plain text editor and not worrying about formatting. Formatting, and form, do matter, a lot. But you can add them later.
Prose is could for creating emotion in the reader, but not for conveying technical information. Know your goals.
This article makes a strong assumption "yes". Because it must, it relies on non-executable and non-verifiable documentation to implement a security gate. But for a very small performance overhead, you can likely do those checks in code, and never worry if your documentation becomes lost, outdated, or simply ignored, and more importantly, now that the requirements are embedded in executable code rather than dumb documentation, you can automated testing of the requirement.
Docs and comments go out of date and people don't know they exist/where to find them. Unit tests are always checked and always maintained.
Can you provide proof that you can turn all human-understandable language into computer-understandable language?
We haven't even started the discussion yet of how much code you spend on writing tests for other people's code, versus how much code you spend writing your own code.
https://simplystatedbusiness.com/wp-content/uploads/2013/07/... https://www.bartleby.com/141/