5

If we're talking about the phrase "source code", isn't that naturally and implicitly plural?

Consider the following sentence:

All of the source code for this project is in a public GitHub repository and licensed as MIT.

Is it:

A. "source code"
or
B. "source codes"

I posted this on Twitter, and I'm truly curious which one is correct here and why?

2
  • 27
    It's a mass noun and as such is used in the singular.
    – Hellion
    Feb 8, 2022 at 4:59
  • According to Macmillan, it's been countified. Though usually used in the non-count sense, individual examples can be treated as count. In this, it mirrors 'code': 'This is written in code' / 'there are three different codes that Julian normally uses'. Feb 9, 2022 at 12:08

4 Answers 4

21

It is very definitely "source code".

There are many uncountable nouns you will encounter in computing. However as non-native speakers contribute increasingly to the literature, it's increasingly common to encounter various terms that are pluralised incorrectly, for example:

middlewares: this seems to becoming increasingly accepted, presumably because often it is necessary to refer to multiple layers of middleware, and there is no convenient concise term for this, for reference, wiktionary lists middleware as 'usually uncountable' and in the footer is listed in the categories for both 'countable nouns' and 'uncountable nouns.

Similarly malwares, softwares (wiktionary states that this as usually an error made by non-native speakers) https://en.wiktionary.org/wiki/softwares

etc.

codes (e.g. 'your codes are buggy') seems to be generally less accepted, but there are lots of examples of usage in the wild, for instance there are countless examples in published papers if you search scholar.google.com: https://scholar.google.com/scholar?hl=en&as_sdt=0%2C5&q=codes+github&btnG=

7
  • 17
    Yeah, just a bit of free advice: unless you really know what you're doing, never, ever put an S at the end of any of these words: software, firmware, hardware, middleware, malware, or code (in the programming sense).
    – Marthaª
    Feb 8, 2022 at 15:14
  • 2
    @Marthaª Also the phrase "A software" should be avoided for exactly thec same reason. I'd bet that the same people who talk about "a software" would never talk about "a hardware" which makes little or no sense.
    – BoldBen
    Feb 8, 2022 at 18:21
  • 1
    @Marthaª "codes" in the programming sense is fine as a verb.
    – Hearth
    Feb 9, 2022 at 5:25
  • As a Software Engineer of 20 years, to put s at the end of these terms is deliberately incorrect, in our predominantly text based culture it is an indicator of a facetious statement used to lighten the tone of what could be interpreted as a very serious or dry conversation. Feb 9, 2022 at 6:11
  • 1
    As someone in the industry, the only people who say things like "codes" are (a) foreigners, (b) academics for some reason and (c) newbies. These may be a large number of people and it's certainly the dictionary's job to record that. But as a term of art, it is a mass noun only.
    – siride
    Feb 10, 2022 at 0:16
6

It is A. Perhaps it’s because the term code refers to the collection of all the instructions that make up a program. It could be one instruction, one line of instructions, or 150,000 files each with thousands of lines of instructions. As a professional programmer for about thirty years now, I’ve never heard a colleague use “source codes”, or ever read that in any industry publications. As a side note, you can refer to source code as “the source”, but I never really hear “the sources”.

1
  • Have you come across the countified plural form 'furnitures' (eg 'the furnitures of Louis XIII and Louis XIV are markedly different'? Though, to be fair, I suspect most people in the trade have. But Macmillan has picked up on a reasonable number of examples of 'source codes'. Feb 9, 2022 at 15:45
0

The use of code in this context is consistent with and derives from its wider use.

Cambridge

set of rules that are accepted as general principles, or a set of written rules that say how people in a particular organization or country should behave:
Clinics will be subject to a new code of conduct and stronger controls by local authorities.

a set of principles that are accepted and used by society or a particular group of people:
a moral code
a code of behaviour/ethics

COMPUTING specialized:
a language used to program (= give instructions to) computers:
The children are learning to write code
The problem was fixed with about 150 lines of computer code.

In all these cases the code is a set of something (principles, rules, instructions …). The contents of the set or code may be plural, but it is singular.

6
  • 9
    It's really non-countable, not singular. We "have some source code", or we just "have source code". We don't have "a source code".
    – bdsl
    Feb 8, 2022 at 14:20
  • @bdsl Code is in principle countable. For example, we talk of legal codes, See britannica.com/topic/law-code for a typical usage involving several distinct codes. Being countable, it may exist in singular or plural forms. To make up a more pertinent example: "A source code appropriate to this problem may involve object-oriented programming but a source code based on recursive techniques may be faster". Or look at docs.microsoft.com/en-us/dynamicsax-2012/appuser-itpro/… "The process for setting up a source code includes the following tasks..."
    – Anton
    Feb 8, 2022 at 15:49
  • 6
    @Anton: Those uses would all be wrong in a computing sense. And the Microsoft link is about a very different use of "source code", referring (as far as I can tell) to a unique id (the "code") used for tracking something's source. It is incorrect to say "a (source) code" when referring to a software artifact written in a programming language. You could say "an algorithm appropriate…", "a program appropriate…", or "a technique appropriate…"; you could also say "code appropriate…" or "writing code appropriate…", but I think the former 3 would be more natural (due to meaning, not syntax). Feb 8, 2022 at 16:07
  • 1
    What @AntalSpector-Zabusky said. The noun is source code. It's not really a noun code with source as a modifier.
    – bdsl
    Feb 8, 2022 at 18:33
  • 1
    @bdsl: Non-countable nouns are singular in the sense that they are used with singular verb forms and pronouns : "The source code is available and it is licensed under [_] licence". Thinking of them as "intrinsically plural" as suggested in the title might lead someone to the wrong conclusion that one should write "The source code are available and they are licensed..."
    – herisson
    Feb 9, 2022 at 4:52
-4

No source-code IS NOT intrinsically plural, but there is NO plural form of this noun. It is known as Mass or Uncountable noun. In many cases if you intended to use a plural, then the simpler term code or sometimes source is used if a programming context is implicit.

The general reason that this is a mass noun is that it is hard to classify even potential boundaries of discrete individual units of source-code, the results would be highly subjective to the given context, so much so that it doesn't make sense to even try to define what a single unit might be, when we need to define boundaries there are specific terms to use that represent the type of boundary. There are many other computing terms that fall into this category.

There are some contexts when the subject is deliberately meant to refer to multiple unrelated repositories of source code, to add emphasis to the individuality of the separate repositories you might be tempted to use the term source codes as a form of collective noun in this context but it would be incorrect and there are other terms for identifying the individual elements, in this case repository or project are acceptable and they greatly reduce the ambiguity of the statement. Consider the following examples

  • (wrong) "I searched all of the source codes in GitHub."
  • (good) "I searched all of the repositories in GitHub"
  • (OK) "I searched all of the projects in GitHub"

Whilst comprehendible, the first example should be avoided because in this context it is still ambiguous if the subject is the source code of the GitHub platform itself, or the code that is stored within it.

I agree with the technical definitions offered by these well cited answers: @Mark-Allen and @Anton but we should acknowledge that it is still common to see the pluralisation form of these computing terms in non-technical contexts.


The origins of the incorrect plural form might be related to non-native english speakers as defined here:

Similarly malwares, softwares (wiktionary states that this as usually an error made by non-native speakers) https://en.wiktionary.org/wiki/softwares

But that doesn't explain on its own the general motivation or intention when used by authors who should otherwise know better.

There is a Hipster subculture in software development* that exists outside of technical documentation, where it is cool or in vogue to deliberately misspell these common uncountable computing nouns by appending an s to indicate a facetious or sarcastic undertone to the statement.

As the community of developers predominantly uses text based communication for both professional and social interactions they have organically evolved separate rich vocabulary for colloquial or informal conversations as well as some more specific nomenclature for slang terms to help convey tone and intent without having to specify specific emotions and feelings in plain text, similar to how emojis are used today by everyone else.

  • This form of mockery is a derivative form of leetspeak and generally represents the author as someone who thinks off themselves as a subject matter expert or perhaps 133t, who is deliberately impersonating the stereotype of a noob or someone who otherwise does not yet understand or take seriously the technical domain of programming or hacking.

*I don't want to offend the purists by claiming that this culture has permeated all facets of Software Engineering, even though it has

To enhance the effect, one can substitute the s with a z or in an extreme case if you wanted to appear especially arrogant you might double the s.

  • Due to the double nature of the statement being facetious or sarcastic if the tone is not clear then look for further devices like emoji to add clarity.

I like this example usage from this page that is itself a reference to other common posts where the user 'want the codez', it's not the Queen's English and a technical document or thesis is not likely to be afforded much respect if it uses this language, but it is part of the vernacular for this domain.

You would pull if you want the histories merged, you’d fetch if you just ‘want the codez’ as some person has been tagging some articles around here.

  • "want the codez" used in comments on a technical forum will specifically indicate that the poster is not interested in background theory or discussions, they have assumed the persona of a noob, but in this case one who is not interested in evolving their understanding of the topic and as such are likely to recieve a low quality response.
2
  • source-code IS intrinsically plural. This is either wrong or very misleading. Additionally, there is a lot in your answer that does not address the question.
    – Greybeard
    Feb 9, 2022 at 12:14
  • OP's question was incorrect, but to their meaning, yes the plural form of source-code is source-code. I was tailoring my resposne specifically in reference to OP's tweet that they referenced. So I agree with my statement being misleading, that was a final edit at the end to make it easier for OP to interpret. A "No but yes" answer would be just as confusing. No one else offers an explanation as to why even though it is incorrect to use source codes there are so many cases of its use in media and online forums. I'll change it anyway. Feb 9, 2022 at 14:06

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