• Very interesting article. I don't think that T-SQL's short-circuiting or lack thereof has ever caused a problem for me. Because most of my coding has been in some version of Visual Basic, which does not short-circuit expressions, if I know that the order of the expressions matters, I tend to write my expressions to avoid problems. For example:

    -- IF epressionA AND expressionB THEN Statement1 ELSE Statement2

    IF expressionA

    BEGIN

    IF expressionB

    EXEC Statement1

    END

    ELSE

    EXEC Statement2

    However, when I am writing in C, I am confident about short-circuiting, so if I have a pointer p that may be NULL, I will happily write:

    if (p != NULL && p->field1 == someValue)