2

In some programming languages, a variable may have a special value 'null' to denote an absence of any object. What term should be used to describe the property of whether or not a given variable can hold a 'null' value?

To further explain, if a variable can hold a 'null' value it is a 'nullable' variable. If it cannot, it is a 'non-nullable' variable, that is, assigning a 'null' value to such variable is a mistake.

What is the best term for such a property? Three possibilities are 'nullity', 'nullability' or 'nullness'. Which is preferable, or is there some other, even better word choice?

Here are some examples of each of three terms (with sources cited), which are contextually relevant to my use case:

  • 'nullness': Eclipse IDE documentation

    Also a nullness default can be applicable at a method which is in conflict with an inherited null annotation.

  • 'nullness': "Incremental Language Independent Static Data Flow Analysis" by Fabian Streitel PDF:

    We therefore define the nullness of a variable at a certain point in the source code as one of the following values...

  • 'nullity': JML Reference Manual

    6.2.13 Nullity Modifiers Any declaration (other than that of a local variable) whose type is a reference type is implicitly declared non_null unless (explicitly or implicitly) declared nullable. <...>

  • 'nullability': "Swift is open source and why you should care" by Paris Buttfield-Addison O'Reilly

    Because a variable's nullability can be determined at compile time, a huge number of null checks can be avoided.

  • 'nullability': Wiktionary definition

    (computing) The state or property of being nullable

9
  • 1
    Nullity, nullness do not mean an ability but a quality. If anything, it can only be nullability, but that sounds a bit odd to me. There might be a better alternative.
    – Kris
    Commented May 29, 2018 at 11:43
  • 2
    en.wiktionary.org/wiki/nullability You need to do a bit of homework first. Good Luck all the same.
    – Kris
    Commented May 29, 2018 at 11:44
  • 1
    I think you have your terms confused. The fact that a variable is "non-null" is unremarkable unless it's also "nullable". The first is a qualification of the state of the the variable, the second an attribute of its declaration.
    – Hot Licks
    Commented May 29, 2018 at 11:49
  • 2
    Please include the research you’ve done. Questions that can be answered using commonly-available references are off-topic. Commented May 29, 2018 at 13:08
  • 2
    One would assume that, were the words in the lexis, 'nullity' and 'nullness' would mean 'having [been assigned] the null state' and 'nullability' the meaning 'having the potential to take / be assigned the null state'. However, assuming you've done reasonable research and the questionable Wiktionary entry is the best authority available, I'd say this question is now not about standard English usage and needs asking on a dedicated website. Standards of acceptability vary between registers; I only use '1010 acid' in a chemistry register or when making this point. Commented May 30, 2018 at 8:22

2 Answers 2

1

The ability for a variable to hold a null value can be described as "being nullable" or "having the property of nullability". The decision to use one term versus the other depends on the part of speech required by the specific sentence using the term.

The Wiktionary definition for nullability does have external references. To view the external references, click on the little down arrow where it says [quotations], and the references will appear as a drop-down. This external reference from the Wiktionary entry is a good example of how either nullable or nullability can be used, depending on the specific sentence in which you are using the term:

2006, Eric Gunnerson, A Programmer's Introduction to C# 2.0, page 271:

Because nullability is one of a number of attributes of any particular database field, and because dealing with changes in nullability is no different from dealing with name and data type changes, the idea of making a value type nullable in C# when it isn't nullable in the database just in case the underlying database schema changes makes little sense.

2

In programming terminology (your specific context—and stackoverflow.com might have been a better site for the question), such a name is already given—there is no need to reinvent it. At least according to Microsoft, what you're talking about is a value type that has a nullable structure.

Represents a value type that can be assigned null.

A type is said to be nullable if it can be assigned a value or can be assigned null, which means the type has no value whatsoever. By default, all reference types, such as String, are nullable, but all value types, such as Int32, are not.

2
  • 1
    Sorry, this does not answer my question. Nullable structure is not a replacement to the word I'm looking for, like "high person" is not a replacement to the word "height". Commented May 30, 2018 at 3:09
  • 1
    If nullable is not correct (structure doesn't need to be part of it), then you're going to have to give several example sentences that make your context clear. I can see that there is a syntactic difference between it has nullability and it is nullable, but it's not clear how that affects your specific use case. Commented May 30, 2018 at 4:02

You must log in to answer this question.

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