Programming Languages – How to Document a Reference Manual

documentationprogramming-languages

We are looking at revamping documentation across our product line. Part of that includes reference manuals for a programming language used as part of the system.

When writing a reference manual for a programming language, what is the best way to structure it for maximum usability to those new to the language?

What are the key aspects for each keyword documented?

  • Syntax
  • Description
  • Arguments – if applicable
  • Return values – if applicable
  • Example of usage?
  • Any others I'm missing?

Should concepts (such as locking strategies, performance related details) be also documented in this reference manual, or is that a separate document?


This is for external consumption. We already have full doc sets (see: http://www.rocketsoftware.com/u2/resources/technical-resources). Working out what we should do different – I already have my ideas, but as always, I try not to rely solely my my opinion.

Audience: Technical developers using our database(s) & tools to produce software across many industries.

Best Answer

Organize documentation in accordance with target audience needs.

In your case, primary audience are apparently software developers. The parts to consider here are to address different "sub-audiences" of this one:

  1. Hello World.
    Those willing to quickly get the taste of it, just build and run sample application to see how it looks like.
    Think of the audience like one addressed by MySQL "15 minutes rule":

    ...a user to be able to have MySQL up and running 15 minutes after he finished downloading it.

  2. Fundamentals.
    For the guys willing to quickly learn things necessary to start producing working software.
  3. Advanced topics.
    For developers already well familiar and practiced with fundamentals, interested to know what is there beyond. Mainstream topics that have not been covered in Fundamentals.
  4. Style Guide / Recommended Practices.
    Subjective advice and guidance for those interested in the way how you recommend to do things.
    The question does not indicate whether this could have a substantial audience in your case, so the options to consider are to include it as a part / appendix of Advanced topics or even drop it completely.
  5. Quirks.
    Obscure topics, outside of mainstream, that might be of interest to pretty limited fraction of your audience. For example, if you have legacy line, or stuff like upgrade / migration / interoperability with legacy - put it here. If there are some side effects for some function at particular "exotic" environment, it goes in this part.
Your secondary audience are maintainers of the manual. These guys can make or break how things work for your primary audience, so you better take care of their needs and issues.

What if something in the manual is questionable / ambiguous? What if it turns out that thorough explanation of particular concepts would make that manual too hard to read? What if it turns out that particular version of the manual has mistakes?

Two things to consider for maintainers are:

  1. Technical/formal specification.
    Whenever there is a questionable / ambiguous / hard to explain topic in the manual, the reader can be referred to particular paragraph in the specification for a strict and clear, "official" statement on that. Strict and complete (and most likely boring) description of language syntax would better go there.
    Paramount considerations for Specification are technical accuracy and completeness, even if these come at the expense of readability.
  2. Online supplement.
    Just reserve some URL and put it in the beginning of every document you release, so that the guys wondering what the hell they have just read could go there (instead of pestering manual maintainers) and find the mistake explained.

    Errata > Fundamentals > Release 2.2 > Typo at page 28, second sentence starts with luck, read lock instead.

Concepts such as locking strategies, performance related details should be included (possible partially) in where you expect target audience need it.

E.g. manual maintainers would apparently be interested in a complete, accurate description of concurrency and locking in the formal specification - put it there. Readers of Fundamentals or Advanced topics might be interested in an overview / introduction / guide extracted from specification and tailored to their needs etc.


It could be helpful to arrange a comparative study of reference documentation provided for other languages like yours. Aim this study at leveraging experience gained by those who did it before and learning how to avoid mistakes they made.

The last but not the least, consider setting up documentation development in a way similar to software development. I mean things like version control, regular releases, issue tracking, quality assurance etc. You may want to make some compromises though if it turns out that your technical writer(s) are not really comfortable with stuff like that. We don't want to get crappy content "in exchange" for perfect development process, do we?

Related Topic