I always used (a)Nullable<>.HasValue
because I liked the semantics. However, recently I was working on someone else's existing code base where they used (b)Nullable<> == null
exclusively instead. Is there a reason to use one over the other, or is it purely preference?
(a)
int? a;
if(a.HasValue)
...
(b)
int? b;
if(b != null)
...