Which one is better:
- When function
read
returns an error, the program crashes. - When
read
function returns an error, the program crashes. - When
read
-function returns an error, the program crashes.
I'm writing an academic paper.
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It only takes a minute to sign up.
Sign up to join this communityWhich one is better:
read
returns an error, the program crashes.read
function returns an error, the program crashes.read
-function returns an error, the program crashes.I'm writing an academic paper.
It is more standard to use read()
, with or without "[the] function".
"strlcpy and strlcat—Consistent, Safe, String Copy and Concatenation" [[ Miller & Raadt 1999 ]] :
...
The strlcpy() and strlcat() functions provide a
consistent, unambiguous API to help the programmer
write more bullet-proof code.
...
Updating older
code to use strlcpy() and strlcat() should serve to speed
up some programs and uncover bugs in others.
...
It has both with & without "function" , though always after.
"The Linux Programming Interface" [[ Michael Kerrisk 2010 ]] :
...
The principal topics of this and the next few chapters are the system calls fork(),
exit(), wait(), and execve().
The fork() system call allows one process, the parent, to create a new process,
the child.
The exit(status) library function terminates a process
...
In the implementation shown in Listing 24-3, the result of func() must be expressed
in the 8 bits that exit() passes from the terminating child to the parent calling wait().
...
It has both with & without "function" (or Equivalents like [system] call), both before & always after.
In all cases , the "guidelines" seem to be :
Always use "()"
Always use "the" when starting a Sentence or when introducing a function , not when it is a generic function
It is not mandatory to use "function"
When using "function" it can come before or after
Do not use hyphen.
This is a common style guide , the Publisher in your Case may have other in-house suggestions. Use what-ever is necessary or natural.
I used to edit and review technical manuals in English and German, and this would often happen in translations into German by an English speaker, or into English by a German speaker. German grammar puts the definition after the type ("function [read]"), while English grammar does it before, often with an article ("the [read] function").
In English, the name would conventionally come before. Your second suggestion looks natural to me (UK English), while the first would lead me to think it had been translated from another language. I've not seen the hyphenated version before, but it looks unusual rather than wrong.
That said, Prem's suggestion and David's comment to check local style guides is worth following.