VSDiagnostics icon indicating copy to clipboard operation
VSDiagnostics copied to clipboard

Implement NonExpressiveConditionalComparison

Open Vannevelj opened this issue 8 years ago • 0 comments

Some programmers have the habit of using if(null == variable) rather than the more expressive if(variable == null). I think we should make a code fix that automatically puts these things in the perspective of the variable whenever possible.

This includes the beforementioned null check but also things like if(5 < variable) which should become if(variable > 5).

I think we should go for equality and comparison operators. https://msdn.microsoft.com/en-us/library/6a71f45d.aspx

Vannevelj avatar May 09 '16 18:05 Vannevelj