blah blah blah is here! blah blah » Close

1
votes
1 answers

How do you check for nulls and equality? var == null or null == var

salman
510

I was taught at my first job that whenever you check for nulls or equality, you should reverse it so it looks like: [code] int x = 10; if(10 == x) { } User user = null; if(null == user) { } [/code] Reason being was that ...

Feedback