I come from a C/C++ background and recently started a new job doing C# work. I find in a lot of code and examples online people use this convention in if statements
if(obj != null)
I remember being told to avoid using negative logic when possible. So why isn't something like
used instead? Is there a code standard that states to use the former style of coding? I would think that these two statements evaluate the same, but perhaps they evaluate differently?
Any input is much appreciated.