When body is one line long and a statement:
if ((...) &&
(...) &&
(...)) body;
[else if
((...) &&
(...)) body;
[else ...;]]
When body is more than one line long:
if ((...) &&
(...) &&
(...)) {
body;
...;
} [else if
((...) &&
(...)) {
body;
...;
} [else {
...;
}]]
In general, it's always
((...) &&
(...))
Why? I'm used to Lisp, so I find it more readable than if ((...) && (...) && (...)) ...;
The awkward indentation of else if is needed to get conditions and body aligned with the first if, but I usually never need complex else ifs.
>>2
>most compilers do it by evaluating the first condition and branch if it fails
Most compilers!? It's called short circuiting and shit loads of programs depend on this so-called ``optional'' behaviour for their integrity. Surprise, surprise it's actually standard, get back to /g/ you codeless fiend.