|
|
|
|
|
by hello_moto
5504 days ago
|
|
Yes, I'm well aware of that. But my point is "how, do you think, people use it in the real world". It's just like any other programming languages: people tend to abuse it. At the end of the day, it all depends on your developers. |
|
Sort of. In your WS example, if you had better developers then they could have defined the interface to accept Nullable<DateTime> instead of DateTime. So the language does let you express that null is an allowed value.
The feature request for the language is to make it possible to express Nonnullable<MyClass>. Regardless of your developers, the best that they would be able to do is throw an ArgumentNullException (which I see thrown for all over the place) without that support.
I'll accept that there may be a situation where a client sends junk to a service, and the service treats the junk as null, but that requires both sides to be in on it - in which case, they would be able to agree to a signature change instead. But they can only agree to the signature change if the language supports it.