|
|
|
|
|
by mpweiher
4913 days ago
|
|
Step back for a second and think about what the number 0 means. If I give you 0 dollars, what have I given you? Or go to Wikipedia: 'The wThe word zero came via French zéro from Venetian zero, which (together with cypher) came via Italian zefiro from Arabic صفر, ṣafira = "it was empty", ṣifr = "zero", "nothing". ord zero came via French zéro from Venetian zero, which (together with cypher) came via Italian zefiro from Arabic صفر, ṣafira = "it was empty", ṣifr = "zero", "nothing".' |
|
Now, you should step back for a second and think about what the value 0 means in a program. Take the following function:
Does 0 mean "the next event is immediate", or does it mean "there is no interval because there is no next event"? 0 here does not necessarily mean "nothing".An option type gives you a different state for "there is no value here, at all". Putting a zero into an int certainly does not signify "no value". It signifies a value, and that value is zero.
What number is greater than three but less than one? Nothing. There is no such number. "0" is not a correct answer.