Quick question here about short-circuiting statements in C#. With an if statement like this:
if (MyObject.MyArray.Count == 0 || MyObject.MyArray[0].SomeValu
Yes,
For AND operations if any of the operand evaluated to false then total expression evaluated to false then there is no need to evaluate remaining expressions, And in case of OR operation if any of the operand evaluated to true then remaining evaluation can be skipped
So by using && or || operator, whole expression can be evaluated to true or false without evaluating all sub expressions.
But consider its side effect also. This article might be helpful to understand short-circuit evaluation in depth with some real world examples.