Other languages which support immediate ifs do it by using a conditional expression, introduced by a ternary (three-part) operator. In that case, because the conditional expression is a language construct rather than a function the result expressions can be conditionally evaluated.

Where the solution is provided by a function, whether internal or UDF, you will always have to evaluate both result expressions regardless of the result of the conditional test.