Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 10 years ago.
短路求值是大多数现代编程语言的一个重要特性,没有理由避免依赖它。如果没有它,与指针相关的测试将(不必要地)更加复杂并且可读性较差。
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.
当然,这是一个很好的设计,每个人都知道期待它,并且它比使用嵌套条件更好。
Of course it's good design, everyone knows to expect it and it beats using nested conditionals.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(2)
短路求值是大多数现代编程语言的一个重要特性,没有理由避免依赖它。如果没有它,与指针相关的测试将(不必要地)更加复杂并且可读性较差。
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.
当然,这是一个很好的设计,每个人都知道期待它,并且它比使用嵌套条件更好。
Of course it's good design, everyone knows to expect it and it beats using nested conditionals.