Re: C# Nullable types



On Wed, 04 Apr 2007 12:20:48 -0700, Scott M. <s-mar@xxxxxxxxxxxxx> wrote:

Something having an unknown value is not, in any way, related to a
dissussion of null. The very word you use "unkown" implies that there is, in fact, something to "know". A null value indicates the exact
opposite of that, that there is no value at all. That's why I said
that your alaogy was not a good one.

IMHO, you are making a mountain out of a molehill.

The exact meaning of "null" depends on what the designer of the code using "null" intends it to mean. While I do see the difference between something having a price that is not known and something not having a price at all, I see absolutely nothing wrong with someone writing code in which "null" can mean the former. For example, suppose you have a database of products available for sale. You know ahead of time that *everything* has a price. Why in the world would you use "null" to indicate something that has no price? Your set of data would never use the value "null" in that case, and there would be no reason to even use a nullable type.

"Null" means what the code designer says it means. Nothing more, nothing less. Your complaint about the analogy provided is pointless. If someone wants to use a "null" value to indicate that a value is unknown, rather than to indicate that there is no value, what's it to you? How in the world is it so wrong to do so?

When I run into situations where a value is unknown to me, I set up a
variable to capture that value. [...]

And what if according to your definition of "null", your variable will never take on the value "null"? Then you've wasted extra storage for no good reason.

You seem to be discussing what a "nullable type" is, rather than the meaning of "null".

Given that "the meaning of 'null'" is arbitrary, while "what a 'nullable type' is" is not arbitrary, it seems to me that the latter is a more sensible thing to discuss.

Pete
.



Relevant Pages

  • Re: FS: Several Pins in South Florida
    ... with other collectors in the area regarding my reputation. ... just looking to get a reasonable price on ... want a decent example of a game at a fair price, ... reason) please ask and I will do my best. ...
    (rec.games.pinball)
  • Re: FS MONOPOLY $1700 (practicly new)
    ... has new rubber kit that goes with" ... if you dont like the price, ... Hate the game. ... saying you are a bad person so no reason to say stupid things. ...
    (rec.games.pinball)
  • Re: Bush Mcsame
    ... price of gas is beyond belief and the administration is still filling ... Obama is a great thing...They are BOTH getting more first time voters ... when one and only one of the two gets the nomination. ... The only reason I stay with them enough to post 10 thoughts a month is ...
    (soc.retirement)
  • Re: A word of warning, was:- ER40 Backplate mounted chuck
    ... my reason for raising the fact that I had phoned in January was ... publication and expected a price advertised in December. ... smaller 100mm diameter chuck until I spoke to him, ... the contract was flawed, as the price charged was not the price quoted. ...
    (uk.rec.models.engineering)
  • Re: A word of warning, was:- ER40 Backplate mounted chuck
    ... publication and expected a price advertised in December. ... smaller 100mm diameter chuck until I spoke to him, ... You do not have to give any reason for this, and whether your word is in doubt or not is irrelevant. ... You have to give a reason for this, but in this case it's pretty obvious that the contract was flawed, as the price charged was not the price quoted. ...
    (uk.rec.models.engineering)