4 ms·
Why don't you use int? rather than Nullable<int> - aren't they equivalent?
by arethuza 15y ago
Why don't you use int? rather than Nullable<int> - aren't they equivalent?
- lallysingh 15y agoThe point is, all values of the int are available. Null is stored somewhere outside the underlying int.
- arethuza 15y agoIt was just a question about the syntax used - why type Nullable<int> when there is direct syntactical support in C# for nullable types - in this case you could simply type int? rather than Nullable<int>
- endianswap 15y agoAt the very least Nullable<T> is a lot friendlier to search than T? if you want to learn more on the subject.
- bfung 15y agonot everyone is familiar with C#, and Nullable<int> conveys better meaning in writing to that kind of audience.
- deleted 15y ago[deleted]
- troygoode 15y agoint? is syntactic sugar for Nullable<int>, which didn't seem worth getting into :-)