Rarely do I encounter and and | logical operators in other codes instead of || and & &. I did a quick research because I never used them and did not know what it was for. A && B means that if A is false, B will not be evaluated and it will return false.
A and B means that if A is false, B will be evaluated even if the form also returns false.
Of course, this is the same game with | and ||.
My question is: does it make sense in any case to evaluate the second member if the first determines the grade? I can imagine a code in which the second member does something super important logic in the clod, and therefore it should be evaluated, but I suspect that this is bad practice. Is it enough to do | and exist?
from the commentary, to make it clearer: I have a feeling that the program is not optimal and works well, or better said: well designed if all logical members should be evaluated.
source share