I read the following in a computer programming book:

In other languages, one would call such a value a constant.

However, the following appears grammatical:

In other languages, one would call such a value constant.

Which one is correct?

  • 2
    And don't forget Osborn's Law - "Variables won't; Constants aren't" – Laconic Droid Sep 23 '19 at 21:39
  • I'd have written it, "In other languages, one would call this type of value a constant." (Nancy and fsfds are correct, though.) – RonJohn Sep 24 '19 at 0:01
  • 1
    @Kevin: The context could just as well be explaining the programming concept of constant (adj) instead of specifically talking about constants (noun). In that case, the adjective is correct. Either option is correct depending on what the focus of the explanation is. Given that it's talking about a value, not a variable, it's pedantically even more likely that the adjective is the most correct here; but the author may have conflated value/variable for the sake of simplicity since this is a beginner's topic. – Flater Sep 24 '19 at 11:06
  • When reading the title, I thought the question was about the first "a". – Mr Lister Sep 24 '19 at 12:16
  • Compare "This is called 'an apple'." – Stuart F Sep 24 '19 at 15:42

It's grammatical to say "a constant" in the first sentence. The indefinite article "a" is required because "constant" is a count noun.

In your second example, you're right, that is also grammatical. HOWEVER, "constant" is appearing as an adjective in that sentence, not as a noun. If you want to use "constant" as a noun, you need to put "a" beforehand in that sentence.

| improve this answer | |
  • 6
    Obligatory car analogies: "In other languages, one would call such a car a sedan" - noun, type of car; vs "In other languages, one would call such a car red" - adjective, description of car. "A constant" is a type of variable (which is not allowed to change). "Constant" is a description of a variable which does not change (regardless of whether it is allowed to or not). – Stobor Sep 24 '19 at 1:52

Both of your example sentences are grammatically correct, but they mean subtly different things.

"One would call such a value a constant" means that "a constant" is another name for a value with the characteristics referred to by "such".

"One would call such a value constant" means that "constant" is an adjective describing the quality possessed by values with the characteristics referred to by "such".

In this case, these two sentences say very nearly the same thing, because English often allows you to say "a [adjective]" to mean "an object with the quality [adjective]". However, this doesn't always work: "X is a constant" is fine but "*X is a red" demands the reply "A red what?" And, for the same reason, you can only say "One would call such a value red", not "*One would call such a value a red".

(Phrases marked with a * at the beginning are things that native speakers would never say.)

| improve this answer | |
  • Nice explanation. +1 – S.S. Anne Sep 24 '19 at 17:13

A constant is correct. In programming and mathematics, a constant is a kind of value that is characterized by being unchanging, as opposed to a variable, which is used as a placeholder for a variety of values.

To use a mathematical example, the generic equation of a line is y=ax+b. a and b are both constants, because for every specific line, they remain the same within that line: y=2x+1, for example. y and x are variables, because you can put any value in for one of them and then use the equation to find the value of the other one.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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