miniblog.

← Back to all posts
47
I'm trying to decide the best voice for PL documentation. Passive: "`let` can be used with destructuring." Reader focused: "You can use `let` with destructuring." Describing the PL: "FooLang supports destructuring with `let`." Anyone have opinions or best practices?

7 Comments

@wilfredh Of the 3, I prefer the last the most, then the first, and middle least.
@wilfredh Just an opinion, but use the imperative. "Use `let` to destructure complex assignments." 1. It tends to be clearer on it's purpose. 2. It sets up following example code well. 3. It asserts both function AND philosophy which tends to make the documentation much more terse.
@badtuple Ooh, that's an interesting take, thanks. I like the idea of trying to assert design principles too. The only downside I see of this approach is that it can sound like "should". I want to communicate that the capability exists, not that it's always the best thing to do. I guess that's just your philosophy point.
@wilfredh destructure with let
@badtuple @wilfredh Or (slightly more verbose but less imperative): "You can use `let` to destructure complex assignments". But I don't have a problem with the passive for technical writing, despite the pundits' dislike (and in some languages, passive is as terse as active) I rather liked the old IBM documentation, which had a "reference" manual with all the language features and their precise definitions, often with short examples; and a "user" manual, which was partly tutorial (e.g., how to use `let` or how to destructure) and partly task-oriented / best-practices (e.g., how to set up a thread, communicate with it, wait for it to end, terminate it, etc.) PS "on it's purpose" should be "on its purpose"
@wilfredh The answer probably depends on the context too. Option 3 is very good when advertising the language. If 'let' is the one an true way for desructuring or the most usual one, or the only one at this stage in a tutorial, option 4 (imperative) seems better. I know passive voice is usually frowned upon, though (but I tend to use it often enough). You could also go for "`let` can destructure hamburgers, like this: `let (spam, eggs, bacon) = hamburger`" Simple sentence, no passive voice, no reader, just what the keyword does / can do.
@wilfredh @badtuple An extra upvote for imperative from me, never passive. Not what you asked here - but I also always advise dropping any use of "should", "could", etc. they just create uncertainty (should it have been implemented? are we still waiting for that feature?) This Google tech writing course I did years ago was pretty helpful: https://developers.google.com/tech-writing/one/active-voice 👈 This is the section about active voice.