Or, more precisely, how I would like these words to mean different things.
The compound word “run time” appears in various forms when I read papers and online articles. I have at least seen the following spellings:
I’ve seen the following implied meanings:
Opinions and guidelines on how to pair the items in these two lists are unfortunately not consistent. For example, the Oxford Learner’s Dictionaries, which happens to describe the spelling enforced by my employer’s style guide, smushes together meanings: it states that runtime can have both the system and duration meaning.
The Google developer documentation style guide says something else. Runtime should have the system meaning, and, interpreting their description liberally, run time should have both the duration and moment meaning. On the one hand, it is reasonable to put two time-related meanings together into one word. On the other hand, I expect that it will often require disambiguation elsewhere in a sentence. This is especially annoying if the hyphenated spelling is disallowed, which is not clarified in the section of the Google style guide I linked above as far as I can tell. Maybe other parts of their style guide dictate that you should hyphenate in the adjective position, or maybe it’s disallowed by omission. I don’t know.
Personally, I find the meaning as indicated by Google’s style guide the most clear, combined with an explicit case for hyphenation:
Runtime: use the system meaning. E.g. “the runtime was updated last week,” or “I’m using version 21 of the Java runtime.”
Run-time: use the moment meaning, but only when used in the adjective position. E.g. “run-time instrumentation is useful for finding bugs.”
Run time: use the duration meaning. E.g. “the run time was reduced by 5%,” or “a run time of five minutes is unacceptable.” In addition, when you want to use the moment meaning, but not as an adjective, this form should also be used. E.g. “typechecking happens at run time in our implementation.”
I first heard of this distinction of the spelling of runtime, in particular with the hyphenated spelling explicitly addressed, though formulated briefly and informally, from Vadim Zaytsev. I don’t know where he got it from. Further outside of my direct social circle James Wilcox and Mike Ernst also agree.
There’s still one wart in this scheme that irks me. Run time can still refer to either the moment or duration meaning. E.g. “we reduced run time by 5s” and “this modification is done at run time”. When possible, I think it is easier to read when you express the duration meaning with execution time. Then, the run time spelling is only used to indicate an exact moment in time, i.e. when a “length” dimension is not present. While this distinction pleases my brain, I understand that in the presence of page limits it’s not always possible to use this strategy. The fact that it’s easy to confuse run with execution is also fair criticism.
A small thanks to ChatGPT for finding the Google developer documentation style guide and James Wilcox’s post on the matter.
Generated with BYOB.
License: CC-BY-SA.
This page is designed to last.
⇐ [This site is part of the UT webring] ⇒