2

I'm currently working on a diploma thesis describing a computer program, and I'd like to unify my usage of italics. The problem is, I do not know whether there is an academic standard for using italics on programming-related texts.

What I currently emphasize:

  • Names of states (my thesis deals with state machines)
  • Names of variables
  • Names of methods

What I am wondering about whether to emphasize or not:

  • Names of processes (As in, individual programs)
  • Names of data types
  • Names of classes
  • Names of macros

I am also wondering whether I should still emphasize a word when it is the only word in a table cell, given it is a word i normally emphasize in the text.

Any help would be greatly appreciated.

closed as primarily opinion-based by Drew, Dan Bron, ScotM, Edwin Ashworth, Ellie Kesselman Jun 20 '15 at 17:39

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Particularly in computer science -- and especially in a thesis -- there ought to be a professional standard you can follow. The graduate school may have one you can use. And you should stop talking about italics as "emphasized"; they're used for a lot of other things, not just vocal emphasis -- boldface is better for vocal emphasis, anyway. And if you're varying the typography of formal entities (states, variables, methods), be aware that there is usually a Code font face available as well, which can be italicized or boldfaced independently. So you can give them all a different look. – John Lawler Jun 19 '15 at 15:52
  • @JohnLawler: unfortunately, some markup standards like HTML, in an attempt to encourage semantic markup rather than presentational, have caused some confusion about and conflation of "emphasis" and "italics," although as you say they are not actually equivalent. (There's some discussion here under "special cases:) googlewebmastercentral.blogspot.com/2012/07/… – sumelic Jun 19 '15 at 17:38
  • I'm voting to close this question as off-topic because OP needs to determine themself which academic style is required by their establishment. – Edwin Ashworth Jun 20 '15 at 8:40
2

Referring to the "holy grail" of programming books, SICP, we can see the authors use a mono-spaced font for all non-literary words (i.e. anything that is a code snippet, function name, variable, state, keyword, etc).

I would reserve italics for actually emphasizing words; using italics to highlight names and such deprives you of the ability to use italics for their other purposes.

Hijacking the purpose of italics in this manner creates a "mode" your audience will have to think in, because when they see italics it won't mean what they think it means by default, which is bad UX. (If papers can be said to have UX...)

However, it's worth noting that they do italicize some technical phrases such as " have access to accounts a1, a2, and a3" (page 264) but these are to indicate instances of variables and do not otherwise appear in the code snippets.

  • 1
    +1, although as John Lawler notes in his comment on the question, the other purposes of italics actually do often cover other areas than emphasis, even if the italics are not used to distinguish variable names. (It depends on the style guide and so on, certainly, but common examples are things like the names of certain cited documents, non-naturalized terms from foreign languages, and scientific species names.) – sumelic Jun 19 '15 at 17:47
  • @sumelic of course, but if OP is religiously italicizing every code-snippet, variable name, function name, macro name, etc. then when he wants to italicize for emphasis as well the reader will be very confused. – mfoy_ Jun 19 '15 at 17:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.