Is it wrong to use the word "codes" in programming context?

I shall use these codes.

  • 18
    Should be used in singular form. "Code" not "codes." – Sergei Apr 11 '11 at 5:07
  • 26
    "Gimme the codez" has become kind of a meme in the programming world, due to the large amount of wannabe (but not wannalearn) people who invade programming forums saying "Plz gimme the codez for xxxx"... definitely NOT correct English. – nico Apr 11 '11 at 5:48
  • 2
    the above comment obviously should read "programmer wannabe"... – nico Apr 11 '11 at 8:34
  • 5
    This question is ambiguous. In this context, does 'code' refer to programming language source code, a standard character set like ASCII code, a proprietary security system password code, command line switch code, or some other valid use of the word 'code' as it pertains to software use and development? – oosterwal Apr 11 '11 at 14:47
  • 3
    Whoa! So much talk without even asking the OP what he is referring to by codes? He only said 'in programming context', not 'program' or 'program segment'. Peeps! – Kris Oct 3 '12 at 7:48

As a programmer, I cringe when hearing this!

In computer science, "code" is used as a mass noun, specifying the collection of instructions in a specific arrangement as a whole and in no specific quantity. Whether it's one line of code or ten pages, it is still referred to as code, not codes.

When "codes" is used in computer science, it typically refers to values or constants used to specify a trait, access or properties, though in my experience, the actual name of those types of items is used over the word "codes". For example, instead of:

Use these codes to specify the read/write permissions of the file.

You would write/say:

Use these constants to specify the read/write permissions of the file.

Or: Use this enumeration to specify the read/write permissions of the file.

With regard to the use of "code":

Use this code to open a file.

Use these functions in the source code to access the database.

This program code needs to be tidied up.

| improve this answer | |
  • 5
    @Shrinath: Only in the sense of security codes, not programming code. [Which is a mass noun.] – Orbling Apr 11 '11 at 7:21
  • 2
    Where's that quoted definition from? Please do not forget to indicate your sources. – RegDwigнt Apr 11 '11 at 9:27
  • 13
    Code is used like sand: you can have 1, but you cannot say 1 code like you cannot say 1 sand. You can use more words to specify the amount: 1 line of code --> 1 grain of sand. But like Nick said, you can use codes as a noun, in a container kind of way. When you have access codes, but then you could read that as: I have 3 lines of access code / – Terry Apr 11 '11 at 10:50
  • 23
    @Nick Bedford: I'm also a programmer who cringes at "software codes" but "code" is not quite like "fish". Code is a mass noun like in djerry's example "sand" above. Mass nouns refer to stuff which cannot be counted and have no plural in certain senses. "Fish" and "sheep" might be called invariant since they have a plural but it happens to be identical to the singular. You can say "two fish" but not "two code". But "fish" also has other plural uses and mass noun forms too - "twho fishes", "I ate some fish" (-: – hippietrail Apr 11 '11 at 11:53
  • 1
    @nico: I agree that it's different than source code. I was merely trying to point out that the way the original question was phrased, "'codes' in a programming context", made it open to a lot of interpretation. Specifically, "in a programming context" does not exclude 'codes' from referring to ASCII, EBCDIC, or unicode character codes, or cryptographic or error correction codes, such as Hamming or Viterbi. – oosterwal Apr 12 '11 at 12:40

Yes, it is wrong to use the word "codes" in the programming world if source code is implied:


source code (uncountable)

  1. (computing, uncountable) Human-readable instructions in a programming language, to be transformed into machine instructions by a compiler, interpreter, assembler or other such system.

Uncountable noun (my emphasis): "a noun that cannot be used freely with numbers or the indefinite article, and which therefore takes no plural form".

The same if code refers to a computer program:

(uncountable) A computer program, or more generally, any defined computing process.

In some other contexts it is all right, for example, access codes.

| improve this answer | |
  • 2
    To be pedantic, in addition to being incorrect when referring to source code it's also incorrect when referring to other types of code, such as intermediate code and machine code. – Scott Mitchell Apr 12 '11 at 4:25

No, this is not correct when you refer to programming code.

There is no plural when you refer to programming code since when you say code you do mean the whole chunk of it. Even if you say for example "different sets of programming code" you notice that no plural is used.

| improve this answer | |

Generally "code" is a mass noun. At the other end of the spectrum from the "gimme teh codez" crowd, "code" is used as a count noun in some scientific and numerical circles: "I looked at 5 different codes for FFT [Fast Fourier Transform] and didn't like any of them."

| improve this answer | |
  • 5
    Although algorithms would be a more appropriate term in that case. – nico Apr 11 '11 at 10:17
  • 6
    Definitely, codes is not valid in that example – Kieren Johnstone Apr 11 '11 at 11:54
  • 3
    @Kieren Johnstone: "valid" means that a group of people use and understand the word to mean that. @nico: No, they use it to mean a program/script/subroutine/function which is an implementation of an algorithm ... could be 5 implementations in 1 to 5 different computer languages of 1 to 5 different algorithms. – John Machin Apr 11 '11 at 22:29
  • 3
    reading your example I immediately thought that you were implying having looked at 5 different ways to perform FFT, so 5 different algorithms. If you want to say that they were written in different languages than, as you say, you should use 5 different implementations to avoid any confusion. Personally I don't hear using the word codes (plural) so much in scientific circles... but there may be regionality in that. – nico Apr 12 '11 at 5:52
  • 1
    "Code" and "Codes" are commonly used as John Machin describes. See also Martin Tapankov's answer. – Marcin Nov 1 '11 at 14:11

"Codes" is actually correct usage and is quite common in academia and in descriptions of commercial products in fields that utilize numerical methods, such as topology optimization or finite element analysis. It is never used to designate a random program that Joe Coder implemented.

What is really meant by this is "well-known and well-tested libraries that do the job as fast as possible". The complexity of the numerical methods is very high, and since performance and accuracy are critical, the demand on the programming skills of their coders is huge. For this reason, the number of numerical method programming libraries is relatively small, and every self-respecting software product in the field uses one or another.

That being said, I would consider any usage outside this very specific context to be incorrect.

Update: By request, some examples below, from different sources:

Hopefully that's convincing enough. More examples to be had if one searches for "optimization codes", "finite element codes" or similar.

| improve this answer | |
  • 8
    Can you provide any sources for the use of the pluralized "codes" when referring to source code? I've never come across this (and am quite dubious about its correctness) outside of its being used by people who don't have a great deal of familiarity with english. – Adam Robinson Apr 11 '11 at 14:06
  • 3
    @Adam: Also note, the usage of "codes" does not mean "source code" in this case. The "codes" in question are numerical libraries which may be open-source, but may very well be licensed commercially in binary form only. And as I said in my post, any usage besides this very narrow scope is incorrect. – Martin Tapankov Apr 11 '11 at 14:25
  • 6
    I'll vouch for this answer. In the scientific programming community, 'codes' is a perfectly acceptable plural to indicate multiple pieces of software that are usually manipulative libraries. @Martin Tapankov is definitely correct, in this narrow context. – pboin Apr 11 '11 at 15:02
  • 8
    It's certainly true that some scientific communities use the plural like this. Whether that community is "correct" to do so is a different matter... – wnoise Apr 11 '11 at 22:29
  • 3
    "codes" is largely used by academics in non-computer fields. Whether this is because they have learned it from others such as them or because they are trying to project an image of competence, it is hard to say. I am yet to meet a computer scientist or a professional programmer that refers to the source of their programs as "codes". Users of this fake plural form should be aware that they come across as pretentious and self-important, yet dilettantish. – Lubo Antonov Mar 13 '14 at 12:45

It is always wrong to use "codes" when refering to a quantity of "source code". Source code is a mass noun which should never be pluralised.

There are some however some other cases where it is permissible to use "codes" in a programming context:

  • When it is used to describe some form of pre-defined encoding e.g. "HTML status codes 404 and 500 mean page not found and internal server error respectively". Here a code refers to a (singular) element of an encoding so it is fine to pluralise it.
  • When used in a security context, e.g. "access codes". Again, an "access code" is singular so it is fine to pluralise it.

Hence "I shall use these codes" may or may not be correct depending on the context.

| improve this answer | |

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