Code is a mass noun

THIS IS A PUBLIC INFORMATION MESSAGE CONCERNING THE CORRECT USE OF THE WORD “CODE”.

I’ve read many RoboSumo blog posts over the last couple of days that use the word “code” incorrectly. When speaking about programming, “code” is generally used as a mass noun rather than a count noun. To see the difference between mass nouns and count nouns, let’s look at examples of each.

A count noun is a noun (the name of a person, place or thing) that you can put a number in front of to specify a certain quantity. Words like “a” or “an” might also precede a count noun if there’s only one object.

Count noun Example sentence
Apple I ate three apples.
Bicycle I bought a new bicycle yesterday.
Book I own hundreds of books.
Robot At the end of the semester each robot competes in a sumo tournament.

A mass noun is a noun that you don’t put a number in front of to specify a quantity.

Mass noun Something you can say Something you can’t say
Water I drank a glass of water. The jug contained a water.
Sunshine We enjoyed the sunshine yesterday. There were many sunshines yesterday.
Petrol I put some petrol in my car. There are few petrols in my car.
Code I wrote the code for my team’s robot. I downloaded a code onto my team’s robot.

Some important points:

  • In programming, the word “code” is used as a mass noun, which means you don’t say “a code” or “codes”.
  • In the English language, “code” can certainly be used as a count noun in other contexts. For example, spies might communicate using a secret code.
  • Frequently, I see “code” written where the word “program” would be more appropriate. For example, I might see “I wrote a code for my team’s robot” when it should say “I wrote a program for my team’s robot”.
  • The word “program” can be used as a count noun or as a verb, but never as a mass noun. For example, you can say “I wrote a program” or “I program the robot”, but not “I wrote a lot of program for our robot.”

Quiz

Finally, to test your understanding of the use of the word “code”, here are ten example sentences. Five are right and five are wrong. Can you tell which are which? (Scroll down for the answers.)

  1. I enjoy writing code for the robot.
  2. There were problems with the robot because of errors in the codes.
  3. Over the course of the semester, we wrote a lot of program.
  4. Whenever I rewire the circuit, I write a new code for the robot too.
  5. Poorly commented code is difficult to understand.
  6. I enjoyed programming the robot.
  7. In order to try out different strategies for our robot, we wrote three different codes.
  8. There are over 100 lines of code in our final program.
  9. We all worked together to write a new code for the robot.
  10. C code is terse.

Answers

1. I enjoy writing code for the robot. Correct …because “code” is used as a mass noun.
2. There were problems with the robot because of errors in the codes. Incorrect …because “codes” is used as a count noun (due to the “s” on the end).
3. Over the course of the semester, we wrote a lot of program. Incorrect …because “program” is used as a mass noun.
4. Whenever I rewire the circuit, I write a new code for the robot too. Incorrect …because “code” is used as a count noun – “a new code”.
5. Poorly commented code is difficult to understand. Correct …because “code” is used as a mass noun.
6. I enjoyed programming the robot. Correct …because “programming” is used as a verb.
7. In order to try out different strategies for our robot, we wrote three different codes. Incorrect …because “codes” is used as a count noun – “three different codes”.
8. There are over 100 lines of code in our final program. Correct …because “code” is used as a mass noun. Note that the number 100 applies to the word “lines” rather than “code”.
9. We all worked together to write a new code for the robot. Incorrect …because “code” is used as a count noun – “a new code”.
10. C code is terse. Correct …because “code” is used as a mass noun. Also, C code really can be terse!
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s