有人使用命名的布尔运算符吗? [英] Is anybody using the named boolean operators?

查看:21
本文介绍了有人使用命名的布尔运算符吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

还是我们都坚持我们教过的&&, ||, !"怎么办?

Or are we all sticking to our taught "&&, ||, !" way?

对于我们为什么应该使用其中一个有什么想法吗?

Any thoughts in why we should use one or the other?

我只是想知道,因为有几个答案表明代码应该尽可能自然,但我没有看到很多带有and,or,not"的代码,而这更自然.

I'm just wondering because several answers state thate code should be as natural as possible, but I haven't seen a lot of code with "and, or, not" while this is more natural.

推荐答案

以前不支持这些.即使是现在,您也需要对某些编译器进行特殊切换以启用这些关键字.这可能是因为旧代码库可能有一些功能 ||名为and"or"not"的变量.

Those were not supported in the old days. And even now you need to give a special switch to some compilers to enable these keywords. That's probably because old code base may have had some functions || variables named "and" "or" "not".

这篇关于有人使用命名的布尔运算符吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆