Possible Duplicates:
(0 == variable) or (null == obj): An outdated practice in C#?
Why does one often see “null != variable” instead of “variable != null” in C#?
I have seen many times people evaluating null to a variable instead of evaluating variable to a null.
if(null== user)
instead of
if(user==null)
I know both are trying to achieve the same functionality.So,Is it some standard or just pure personal preference. Please comment.
user == null
is human speak.
null == user
is Yoda speak.
To the compiler they are the same, so pick the one you are most comfortable with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With