0

What and why should I use, a single line of 'code' or 'codes'?

Example sentence: Today we don't need to write a single line of codes to do anything

4

"Code" in the sense of "computer code" is a mass noun, and so has no plural. It would be "lines of code".

code .... Computing mass noun Program instructions. ‘assembly code’ ... ‘The answer is 609,000 and this is the number of lines of code in the software for the computers and avionics systems.’ (Lexico - https://www.lexico.com/definition/code )

Even among native speakers, non-programmers occasionally get this wrong:

A former computer programmer at Goldman Sachs' Wall Street headquarters has been charged with stealing trade secrets by downloading sensitive computer codes (The Guardian - https://www.theguardian.com/business/2009/jul/06/golman-sachs-computer-codes-stolen )

In other senses (such as "code" meaning an encrypted system of communication or an encrypted message), it is a countable noun and can be pluralised as normal.

4
  • Leetspeakers write about 'teh c0dez' Aug 31 '20 at 13:07
  • 1
    In all probability, it was the source code that the former programmer was charged with downloading, not the opcodes. And as for c0dez - people also refer humorously to the "internets" or "interwebz"... Sometimes things that aren't normally plural can be pluralised for humorous effect.
    – rjpond
    Aug 31 '20 at 13:11
  • Executable computer programs are in machine code, and the instructions therein are opcodes (short for operation codes). Then there are ASCII codes, and so on and so on. A "line of codes" is meaningful, but unlikely in context
    – Peter
    Aug 31 '20 at 13:13
  • Granted. As for the ASCII codes, they wouldn't fall within the definition of computer "code" that I adopted here (Lexico: "program instructions").
    – rjpond
    Aug 31 '20 at 13:19

You must log in to answer this question.

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