23

In my blog (which is about programming) I often use reserved words from different programming languages.

Like this:

When column is nullable in both tables, this query won't return a match of two NULLs for the reasons described above: no NULLs are equal.

Here, NULL is a programming language keyword.

For numerous reasons, I mark them with <code> tag so they are rendered with a fixed width font, not translated into the foreign languages by Google Translate, can easily be seen on the page etc.

In the example above, which would be the best way to mark the plural?

  1. NULLs
  2. NULL s
  3. NULL's
  4. NULLs
  5. NULLS

Option 1 looks ugly on the page (the word and the plural marker are rendered in different colors and fonts)

Option 2 adds a space between the word and the plural marker

Option 3 looks nicest but is not correct

Options 4 and 5 may leave the reader under impression that NULLS is a reserved word (which is not true) and this may be confusing. Also, Google Translate would leave the word as is which would be definitely wrong in other languages.

What would be the least of 5 evils?

5
  • 2
    I'd suggest using option 2 and fixing the CSS so that it looks right. :-) Nov 11, 2010 at 8:32
  • On closer look, you have explicitly added a space before the 's' in option 2. Why did you do that? Stop it and all will be fine. Nov 11, 2010 at 8:34
  • @ShreevatsaR: unfortunately, I cannot fix CSS right here :) I added the space to give you the impression of what will it look like.
    – Quassnoi
    Nov 11, 2010 at 9:56
  • But without the space it looks fine. Where is your blog that has such poor CSS that <code>NULL</code>s looks like it has an extra space? Nov 11, 2010 at 10:38
  • @ShreevatsaR: explainextended.com , and it looks ugly without the space. I use different color for <code>.
    – Quassnoi
    Nov 11, 2010 at 11:00

2 Answers 2

23

Definitely don't use an apostrophe or a capital S to pluralize NULL.

As a programmer, I'd suggest formatting it as NULLs. I think your readers will understand that.

I'd also recommend considering rewriting sentences like that to obviate the need to pluralize NULL. For example:

When column is nullable in both tables, this query won't return a match of two NULL values for the reasons described above: no NULL values are equal.

1
  • 2
    +1. You actively want the reserved keyword to appear different to the plural marker, in terms of colour and font: nulls is fine. I think it looks clear like that, rather than ugly. However, I agree it's probably wise to attempt to reword sentences to avoid these plurals where possible. Nov 19, 2010 at 16:09
17

You don't have to pluralize these code words, because you can always write them as adjectives. For example:

  • How to compare NULL values

  • Do not write too many nested while blocks.

  • Make sure that you map the getDatabasePrimaryKey() methods.

7
  • But why should you? An answer to a problem that says "Do it differently so you won't have the problem" is sometimes useful, but often just annoying. Since we (I and the OP, at least) have no problem with saying "comparing NULLs", why on earth shouldn't we write it? That is how I would write it, by the way.
    – Colin Fine
    Nov 11, 2010 at 18:04
  • 3
    @Colin Fine, that's because you're thinking of the "null" case only. The title of question refers to code words in general. "Null" was the example. Do you write "whiles" and "getDatabasePrimaryKey()s"? Btw, I would write "null value" (as many people) but that's not really the point that I wanted to make.
    – b.roth
    Nov 12, 2010 at 11:46
  • Good point. I think I would write "while"s (with the quotes).
    – Colin Fine
    Nov 12, 2010 at 13:04
  • The problem with "rephrase to avoid the problem" is that it often only applies to a narrow example. Yes this works for NULL, where the noun form is shorthand for an adjective, but what about, say, Object (the class name)? Would you really suggest using "...for all objects of class Object" instead of "...for all Objects"?
    – res
    Nov 19, 2010 at 15:28
  • @res, depending on how the language in question works, either write "for all objects", or rename the class to something more, um, informative.
    – Marthaª
    Nov 19, 2010 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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