When I write computer-related text and want to refer to something (a variable, a function, etc.) that has a unique name, should I add “the” before the name? For example: “Here I call the printf function” vs “Here I call printf function.” Logically it seems that the name is a sufficient determiner, but at the same time I see that many people use “the” here.

  • 9
    Typical usage is to use the determiner or elide both the article and the word function: "I call the printf function" or simply "I call printf".
    – Dan Bron
    Commented May 20, 2015 at 16:45

3 Answers 3


Function is a count noun, and it typically appears with a determiner of some sort:

I called a function.
I called this function.
I called the function.
I called two functions.

Lots of determiners work, as you can see above.

You can add the name of the function as an attributive modifier:

I called the printf function.

And in that case, you've made it specific, so the is probably the appropriate determiner (unless you're in an unusual situation where you have more than one printf function to discuss).

But function needs a determiner, so these are ungrammatical:

*I called function.      (ungrammatical)
*I called printf function. (ungrammatical)

By itself, printf doesn't need a determiner. It's a proper noun:

I called printf.

This is fine too, and I think it's probably more common in speech, but I don't have a corpus to check, so that's really just a guess.

In this answer, the * symbol marks an utterance as ungrammatical.

  • 3
    I like your aside about the possibility of having multiple printf functions available. Covers all the bases! Commented May 20, 2015 at 17:31
  • 3
    It should probably be noted that even though printf is a proper noun, the rules about capitalization of proper nouns generally don't apply. Particularly if you're discussing a case-sensitive language.
    – cHao
    Commented May 21, 2015 at 6:33
  • 1
    Great answer, grammatically, but from the point of computer programming you should always include parenthesis when talking about functions -- since no function is complete without them! So even more correct than anything above is "I called the printf() function."
    – Raydot
    Commented May 21, 2015 at 11:03
  • 1
    ...oh and "I called printf()" would be a more informal use. But you could say something like "This clearly calls for printf()."
    – Raydot
    Commented May 21, 2015 at 11:05
  • 5
    I disagree with "you should always include parenthesis when talking about functions". You're talking about the function itself, not the invocation of it. In fact, printf() isn't even valid code, so what value are the parentheses adding? The name of the function is printf. Its name is not printf().
    – Isvara
    Commented May 21, 2015 at 15:51

The preferred and most common usage is simply "Here I call printf." A construct like "Here I call the printf function" is needlessly verbose. The exception is when the word printf would appear at the beginning of a sentence. It cannot be capitalized because its case is part of its correct spelling, and leaving it uncapitalized is typographically awkward.

  • Or possibly if you're writing for a non-programmer audience, where you need to make it clear that printf IS a function.
    – jamesqf
    Commented May 20, 2015 at 18:52
  • @jamesqf: In that case, I believe the phrasing "Here I call the function printf." would best achieve clarity, conciseness, and description. Commented May 21, 2015 at 3:35

'the' should be used with printf because we are talking about a particular command. We should use 'the' when pointing to a specific thing.

Here I call the printf function

is correct usage.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .