C#

C#

Made by DeepSource

Using the logical not operator to invert binary expressions can affect readability CS-R1108

Anti-pattern
Major

Using the logical not operator ! to invert the result of a binary expression's result can affect readability as it requires that the reader first comprehend the binary expression and then mentally invert the result. This can interrupt the natural flow of reading the code, thereby affecting readability. It is recommended that you refactor this expression.

Bad Practice

var isPi = !(pi != 3.14);

Recommended

var isPi = pi == 3.14;