VSDiagnostics
VSDiagnostics copied to clipboard
Implement NonExpressiveConditionalComparison
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