nouns - A code or some code?


When talking about the source code of a program, my Computer Science teacher sometimes refers to single pieces of code as 'a code'. For example:



For today's task, you need to write a code which outputs "Hello World".



I feel that this is terribly wrong as I would say 'some code' or 'a piece of code'. E.g.:



For today's task, you need to write some code which outputs "Hello World".



Who is right, me, my teacher or both of us?



Answer



"Code" as usually used in the field of IT refers to source code of computer programs. My own intuition is that this is clearly uncountable, so you can speak of "some code" but not "a code". You can also speak of "the source code of a program", which means "the [representation of the program] as source code". However, "code" alone remains uncountable. You could speak of "a code" when used in a different meaning, such as: "he gave me a code with which I could open the locked door" (here "code" is a "hard-to-guess combination of letters/digits").


While Merriam Webster doesn't state anything about the countability of "code" used as shorthand for "source code", Wiktionary gives one of the meanings as synonymous with source code, machine code or bytecode, and these are described as uncountable.


Bytecode is described as countable and uncountable, and while it is not explicitly stated, it seems logical for bytecode (the byte representing a single instruction) to be countable and bytecode (a series of instructions represented as bytecodes) to be uncountable. I wouldn't object to using "a bytecode" in context such as: "this function consistes of a single bytecode", but "bytecode" in the latter meaning would behave like "source code" or "machine code" and be uncountable.


Comments

Popular posts from this blog

verbs - "Baby is creeping" vs. "baby is crawling" in AmE

commas - Does this sentence have too many subjunctives?

grammatical number - Use of lone apostrophe for plural?

etymology - Where does the phrase "doctored" originate?

phrases - Somebody is gonna kiss the donkey

typography - When a dagger is used to indicate a note, must it come after an asterisk?

etymology - Origin of "s--t eating grin"