python/docs-community

Style guide: permit "CPU"?

Closed this issue · 10 comments

The devguide style guide advises against using "CPU":

CPU

For “central processing unit.” Many style guides say this should be spelled out on the first use (and if you must use it, do so!). For the Python documentation, this abbreviation should be avoided since there’s no reasonable way to predict which occurrence will be the first seen by the reader. It is better to use the word “processor” instead.

But it's advice rarely followed. A quick count in the CPython docs (searching for lines with regex "\bCPUs?\b" and "\bprocessors?\b"):

  • 74 "CPU"
  • 48 "processor"

Even the devguide only managed 1 "processor", and it was in the recommendation above to use this word. Compared to 4 "CPU" (1 in the prohibition above and 3 elsewhere).

Other style guides

Well, let's see what some other style guides say.

Google:

CPU
All caps. No need to expand the abbreviation on first mention.

Red Hat:

Capitalization
Unless the acronym or initialism stands for a proper noun, use sentence case for the spelled out version: for example, "central processing unit (CPU)". Not all acronyms are capitalized (for example, "spool"); see the IBM Style Guide or another suitable reference if you are unsure.

Apple:

CPU
Abbreviation for central processing unit. Avoid in user materials; use processor to refer to the chip and use computer or system to refer to the computer itself. For guidelines about spelling out abbreviations, see abbreviations and acronyms. See also computer; processor; system.

Microsoft:

CPU not specifically mentioned or prohibited.

Bishop Fox

CPU, CPUs (n.)
Central processing unit. Do not spell out.

Archaeology

This advice was first added to the devguide by Sandro Tosi in January 2012:
python/devguide@3160c41

It was moved from "Documenting Python":

https://web.archive.org/web/20080214225803/http://docs.python.org/dev/documenting

The style guide mentioned there isn't archived, but it was originally part of the Python source. This advice was first added to the main repo by Fred Drake in July 2001:

python/cpython@9120df3

  \begin{description}
    \item[CPU]
    For ``central processing unit.''  Many style guides say this
    should be spelled out on the first use (and if you must use it,
    do so!).  For the Python documentation, this abbreviation should
    be avoided since there's no reasonable way to predict which occurance
    will be the first seen by the reader.  It is better to use the
    word ``processor'' instead.

The commit message:

Add a little more information about the usage of some terms where the style guide can use a little clarification, and present some minor specific markup.

Make a few adjustments to conform to the style guide.

I had a poke around the old Python-Dev mailing list but didn't find any mention.

So no specific reasoning for this addition.

Suggestion

I think our recommendation is outdated, and we're clearly not following it.

I think it's okay to use "CPU" without spelling out.

Shall we remove this rule, or update it somehow?

Agreed. I see "CPU" occasionally used metaphorically in non-technical mainstream publications (newspapers, magazines) so it has entered the vernacular, and we needn't be so cagey about explaining the abbreviation.

I feel this is the kind of abbreviation where the abbreviation is more commonly understood than the full form.

I also agree that the docs for a programming language can assume a certain amount of background, including understanding the term "CPU." As we look at other doc style guides, we have to remember that our audience may be different than theirs.

I think that there is consensus here that "CPU" seems reasonable in today's language.

@nedbat @gvanrossum I added this to the list that @jablonskidev started for the Editorial Board.

I agree that CPU doesn't need to be spelled out.

However, keep in mind that there is an :abbr: role too:

An abbreviation. If the role content contains a parenthesized explanation, it will be treated specially: it will be shown in a tool-tip in HTML, and output only once in LaTeX.

For example: :abbr:`LIFO (last-in, first-out)` displays LIFO.

For common abbreviations (such as CPU), I would just use :abbr: on the first occurrence. For less common ones, spelling it out explicitly on the first occurrence might be better. :abbr: can then be used again on the first occurrence of each section.

I don't recall what specifically prompted me to add that, and agree the advice is more than a little dated. Let's toss the prohibition.

For common abbreviations (such as CPU), I would just use :abbr: on the first occurrence. For less common ones, spelling it out explicitly on the first occurrence might be better. :abbr: can then be used again on the first occurrence of each section.

You gotta be kidding. This is just too much markup. There's no need. Next you'll want us to mark up nouns with :noun: and verbs with :verb:. :-)

And abbr has limited and inconsistent support for keyboard users, touch users (e.g. mobile) and for screenreader and Braille users:

https://adrianroselli.com/2024/01/using-abbr-element-with-title-attribute.html#Verdict

Please see PR python/devguide#1289 to remove the no-"CPU" advice.

@hugovk Thanks for the update re: accessibility. Makes sense to limit new use of :abbr: where possible.