Search code examples
evaluationshort-circuiting

Is relying on short-circuit evaluation good design?


Are there alternatives that would be more preferred?


Solution

  • Short-circuit evaluation is a crucial feature of most modern programming languages and there's no reason to avoid relying on it. Without it pointer-related tests would be (unnecessarily) much more complicated and less readable.