2

I am writing a technical book and a lot of it is structured as explanations of code examples.

For instance:

var links = data.map(function (d) {
    return {source: nick_id(d.from),
                 target: nick_id(d.to),
                 count: matrix[nick_id(d.from)][nick_id(d.to)]};
});

Followed by:

links is a list of elements that tell us something.

In all versions of the book "links" will have special formatting so it looks like code, the idea being that it's a direct reference into the code sample, which helps readers understand what I'm talking about.

Question is, how should "links" be capitalised?

It's at the beginning of a sentence so it should be "Links", but then it no longer looks exactly like the code sample and technically doesn't represent the same variable since the programming language is case sensitive.

For a more extreme example, what if I want to start a sentence with .map, what are the grammar rules about starting a sentence with a full stop?

I would like to avoid restructuring sentences like the above because links is the sentence subject's name. And a sentence like:

The variable links is a list of elements ...

Is as silly as:

The person John went to the store.

RegDwigнt
  • 97,231
  • 2
    You don't want to start a sentence with anything that is not 'English'. Use an intro just like 'The variable links...' It is not at all silly. You're overthinking it as a technical thing. – Mitch May 19 '13 at 16:04

0 Answers0