A programming concept.

Consider this pseudocode statement.

Result := (Foo.Bar OR Baz.Quux);
Suppose your program is running along, and encounters this statement. It then evaluates Foo.bar, which, for purposes of this example, evaluates to true. Now, what? The program could evaluate Baz.Quux, but whether it evaluates to true or false, the entire expression is true. Consequently, the program can save time by not evaluating the statement.

This can, of course, lead to bugs if the author of a piece of code doesn't expect it, and uses a function with side effects on the right side of the boolean operator to be short-circuited.

Log in or registerto write something here or to contact authors.