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