Checks for pattern matchings that can be expressed using equality.
Why is this bad?
It reads better and has less cognitive load because equality won’t cause binding.
It is a Yoda condition. Yoda conditions are widely criticized for increasing the cognitive load of reading the code.
Equality is a simple bool expression and can be merged with && and || and reuse if blocks
What it does
Checks for pattern matchings that can be expressed using equality.
Why is this bad?
It reads better and has less cognitive load because equality won’t cause binding. It is a Yoda condition. Yoda conditions are widely criticized for increasing the cognitive load of reading the code. Equality is a simple bool expression and can be merged with && and || and reuse if blocks
Example
Use instead: