TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C# Coding Standard
Search

Rule:  6@120

Synopsis:Avoid conditions with double negatives
Language:C#
Severity Level:4
Category:Control flow


Description:

Although a property like customer.HasNoOrders make sense, avoid using it in a negative condition like this:

  bool hasOrders = !customer.HasNoOrders;

Double negatives are more difficult to grasp than simple expressions, and people tend to read over the double negative easily.



Literature References:
Aviva AV1502