News for hackers. Stuff that matters.
Re:The Grand Unified Theory of Documentation by rglover on Thursday April 15, 2021 @06:27PM (#26826946)
Some personal rules for docs:

1. Explain, in plain non-jargon words (nobody cares how smart you are) what problem is being solved, how, and why.

2. Provide contextualized examples (no foobar), not making assumptions about what the reader knows or doesn't know (and avoiding condescending language like "it's easy," "it's common sense" or anything that suggests the reader is "dumb" if they don't get it).

3. Think in terms of a blog post/tutorial, not technical API docs as a starting point. This helps with adoption because people want to understand the thing first and then dig into API (just because you may not doesn't mean that others are the same).

4. Don't be lazy. Show respect for the people taking the time to use your stuff and put in the effort (grammar, structure, quality of examples, etc).

Re:The Grand Unified Theory of Documentation by npunt on Friday April 16, 2021 @01:02AM (#26829688)
Agree to all! When I was rewriting the OneSignal docs I followed the same rules you laid out as well as a few more:

5. Get every step right. Don't make assumptions that the reader knows how to configure something you mention in passing, spell it out. This is especially important if good engineers are writing docs since they leap over little things that less skilled users might not know.

6. Write for translators. Many users don't speak English well and will be running docs through Google Translate. This is a variant of your #1.

7. Consider docs a seamless extension of the product. Use the exact wording and same visual language of the product and make sure docs pick up from where exactly the user was in the product. Evaluate these flows so wherever someone gets tripped up, the right doc is there waiting. Ideally do bidirectional linking so the product itself also links to these.

8. Super consistent language. Figure out your nouns and verbs: someone playing a game is always a 'player' (vs sometimes a 'user' or 'gamer'), someone sending a file is always 'transferring' (vs sometimes 'sending' or 'uploading'), etc. Unless you pay close attention ambiguity is going to creep into documentation.

Re:The Grand Unified Theory of Documentation by eru on Friday April 16, 2021 @01:09AM (#26829742)
About 8: this habit might make your docs sound a bit monotonous, but it also helps with 'grepping' through them.
Re:The Grand Unified Theory of Documentation by vicda on Friday April 16, 2021 @03:35AM (#26830742)
We don't read documentation to entertained, but to solve problems. How searchable your text is extremely important.
Re:The Grand Unified Theory of Documentation by neetrain on Friday April 16, 2021 @01:18AM (#26829804)
I don't know whether it is only in my country, but teachers in school teach students otherwise. Not repeating the same word for the same things is alright for elegant literature, but problematic in the digital era.
Re:The Grand Unified Theory of Documentation by eru on Friday April 16, 2021 @01:27AM (#26829864)
Yes, literature and technical documents have different requirements.
Re:The Grand Unified Theory of Documentation by bobthepanda on Friday April 16, 2021 @11:58AM (#26835533)
At least in the US my undergrad computer science degree had a course on specifically writing technical documentation
Re:The Grand Unified Theory of Documentation by chillfox on Friday April 16, 2021 @12:35AM (#26829508)
"(no foobar)"

As someone with English as a second language seeing "foobar" all over the place in lot's of different contexts really confused me a lot early on. Especially when docs started talking about a "foo" and a "bar".

I still don't understand why it is the generic go to word for examples, it makes little sense.

Re:The Grand Unified Theory of Documentation by ansible on Friday April 16, 2021 @03:17AM (#26830604)
The word "foobar" has a long, long history in computers:

http://www.catb.org/~esr/jargon/html/F/foo.html

Re:The Grand Unified Theory of Documentation by Vinnl on Friday April 16, 2021 @02:01AM (#26830083)
Likewise when learning OOP long ago, it seemed like every tutorial used a car with wheels and a steering wheel as examples. Took me a long time afterwards to understand how it could actually be used in practice.
Re:The Grand Unified Theory of Documentation by chillfox on Friday April 16, 2021 @03:07AM (#26830540)
Yeah, the entire car, engine and wheels thing really disconnected OOP from any practical use for me. It really took a long time before I understood how it applied to real code.

If real examples from a blog or accounting software had been used instead then I would likely have understood it a lot easier.

Re:The Grand Unified Theory of Documentation by eru on Friday April 16, 2021 @01:11AM (#26829752)
I guess it's a combination of people following earlier example, and that it sounds funny.

In economics textbooks, companies always produce 'widgets'. https://en.wikipedia.org/wiki/Widget_(economics)

Re:The Grand Unified Theory of Documentation by hinkley on Thursday April 15, 2021 @08:18PM (#26827810)
I find that people tend to bristle at #1, in part because they tend to think about 'the document' instead of the giant pile of documents that will be produced over the next 3 years, and the fact that sooner or later you're going to be skimming multiple documents to figure out which one had the fix for that one problem or explained why on earth we made some dumb decision a year ago. This is most obvious with Wikis but it applies to an extent to all documentation.

Remind me why I'm here in this document, because I might be in the wrong place.

Re:The Grand Unified Theory of Documentation by eru on Friday April 16, 2021 @01:13AM (#26829768)
Your point reminds me that you shouldn't think about documentation as a one-off thing you are doing for your project.

But in terms of a process. Eg how are you going to keep the docs up to date?

Re:The Grand Unified Theory of Documentation by johnchristopher on Friday April 16, 2021 @03:38AM (#26830763)
It may be due the language barrier or something but there are some phrasing that really throws me of:

> You might send variables to this server function by calling this endpoint from your javascript code.

You might but in fact you must (or you can) because it is the only way send variables to the server from Javascript. It's not like it's a personal preference or that there is another way.

> You can choose to use `register_rest_route()` to register a custom route [..].

But this is the only way to register a route.

Re:The Grand Unified Theory of Documentation by unwind on Friday April 16, 2021 @05:50AM (#26831790)
I couldn't figure out what you are quoting, but to me "sending a variable" signals major confusion with the author, in the general case.

Values (being data) can be transmitted, actual variables (being programming-language constructs to contain values and make them available to operate upon) cannot.

Re:The Grand Unified Theory of Documentation by samus on Friday April 16, 2021 @08:15AM (#26832925)
The wording "might" really triggers me because it stands for something that /could/ happen. It is one of the ways to express the conjunctive mood (possibilities, wishes, ambiguity), which has absolutely no right to exist in a technical documentation.

~~There is only one place where this makes sense: in a best-practices section explaining consequences. But also there I want to see clear facts instead of unclear statements making me chase ghosts.~~

Edit: No, just plain facts please.

Re:The Grand Unified Theory of Documentation by toomanybeersies on Friday April 16, 2021 @09:42AM (#26833747)
This is where RFCs get it right (although technically they're standards, not documentation), with standardised language [1]

e.g.

> MUST: This word, or the terms "REQUIRED" or "SHALL", mean that the definition is an absolute requirement of the specification.

[1] https://tools.ietf.org/html/rfc2119

Re:The Grand Unified Theory of Documentation by JimDabell on Friday April 16, 2021 @03:49AM (#26830840)
As with most things, you can improve the writing by removing unnecessary words:

> You might send variables to this server function by calling this endpoint from your javascript code.

…becomes:

> send variables to this server function by calling this endpoint

…and:

> You can choose to use `register_rest_route()` to register a custom route [..].

…becomes:

> Use `register_rest_route()` to register a custom route [..].

Re:The Grand Unified Theory of Documentation by MaxDPS on Sunday April 18, 2021 @03:09PM (#26855352)
I like your point about condescending language. I’ve found myself using phrases like “It’s easy” in an attempt to not scare people away, but I see how that can backfire. I’m going to keep that in mind.