73
votes

In an XML schema you can mark an element as nillable meaning it can take an explicit NULL value. See nillable and minOccurs XSD element attributes for a great explanation.

What I'm curious about is why is it called nillable? I always see nillable and think it's a typo!

EDIT I appreciate that nil is a synonym for null. What I'm wondering is why nil was chosen, rather than the more common (in computer science) null. Particularly as it should really be nilable (note the single L)!

5

5 Answers

68
votes

What I'm wondering is why nil was chosen, rather than the more common (in computer science) null

This depends on which part of computer science you're coming from!

If you look at programs written in functional languages, you'll see nil every where, and very seldom null. And as it happens, XML and all it's siblings such as XSLT are closely related to functional languages.

12
votes

Nil has the same language roots as null. Nil comes from the Latin for nihil which means "nothing". "Null", while related, comes from the Latin for "none" (literally 'ne-' meaning "not" and 'ullus' meaning "anything"). While they are similar in meaning, they have some slightly nuanced differences.

In practical usage, 'null' is far more common stateside while 'nil' is more common in Europe. Most people tend to use them interchangeably in software development terms but in language usage 'nil' is more common, in my experience.

5
votes

It comes from nil which is another term for null, used in XML. I don't think that there is any specific reason the one the be preferred over the other in different programming languages. It is just an expression. It is used in some sports too, to express 0. http://en.wikipedia.org/wiki/Nil

4
votes

If memory serves, it's called "nillable" because (some of) the SQL people in the room became concerned about possible confusion between the relevant concept in XSD and the relevant concept in SQL. They threatened to lie down in the road to stop the proposal unless the name was changed. So the WG changed the name.

(On the orthographic question, I think nilable would invite pronunciation with a long 'i'; I believe that both American and British English regularly double final single consonants following a short stressed vowel. Cf. 'tag', 'tagging', 'tagged', 'taggable'.)

-4
votes

This term we are using XML WSDL. If nillable is true, then we can also use null value in parameter. I used this and it worked for me.