Shouldn't this more correctly read zero or non-zero ?
Shouldn't this more correctly read zero or non-zero ?
There are 2 words for the same concept because "null" comes from Latin, while "zero" comes from Sanskrit through Arabic.
Etymologically, "null" means "not even one" (by being a diminutive form of "not one").
The use of "null" in some programming languages to mean things like "undefined", "not applicable" or "nothing" is incorrect. For those the right choice is NIL, as in LISP (NIL means nothing).
While LISP had made the right choice by using NIL, it made later the mistake of calling NULL the predicate that tests if something is NIL. That predicate should have been called something like "is_nil".
When C.A.R. Hoare had introduced the word "null", he applied "null" to references, i.e. to pointers, not to the things pointed by those pointers. So a "null" pointer, whose value is zero, points to NIL, i.e. to nothing, and this is an alternative to devising an encoding for the things that are pointed to, where a special value is reserved to encode NIL (like the Not-a-Number values of floating-point numbers).
In British English nil means zero as in a nil-nil draw in football. In this case it is effectively an ordinal number and it means none, not nothing.
> nil(n.) "nothing," 1833, from Latin nil,
In at least several other European languages a draw in football is correctly called "null-to-null".
If in UK it is now called "nil-nil" that must have originated in people with poor knowledge of English and then it was imitated by others.
Both "null" & "nil" come from Latin, where their meaning is "zero" and "nothing" (they are contracted forms of "ne ullum" and "ne hilum"). When first borrowed in English, they were used by educated people, who knew very well their original meanings.
Nowadays, most people have no knowledge about classic languages and poor knowledge about their own native language as it was spoken a few decades earlier, before the widespread influence all over the world of sources that display frequently incorrect language, e.g. TV shows, Hollywood movies, and now YouTube and the like, which leads to many cases when words are used in inappropriate ways. This is annoying because it results in ambiguous language, whose precise meaning cannot be understood without additional verbose explications of what is really intended and it also results in misunderstandings when people read the older literature.
In mathematical language, "null" has always been used correctly, for "zero", and this is the meaning that should have been inherited in any programming language, but unfortunately most popular programming languages are full of mathematical mistakes.
In non-mathematical English language, "null" has acquired additional meanings, e.g. in legal language it may be used for an invalid contract, sentence, law, etc.