What is the difference between if (!x) and if (x == null); that is, when can their results be different?
if (!x)
if (x == null)
!x tests for a false value. This will be true for any value that can propagate to false for whatever reason. This will be true for permutations of false, 0, etc etc.
!x
false
0
x == null is different because var x = 0 will NOT be null... but WILL be false.
x == null
var x = 0