你使用哪些C ++逻辑运算符:和,或不是ilk或C风格运算符?为什么? [英] Which C++ logical operators do you use: and, or, not and the ilk or C style operators? why?

查看:213
本文介绍了你使用哪些C ++逻辑运算符:和,或不是ilk或C风格运算符?为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我个人更喜欢新的操作符,使代码在我看来更可读。



哪些是自己使用的?



还有Emacs不同地突出那些操作符,所以我在看屏幕时获得更多的视觉反馈。我知道旧的操作符可以突出显示,但ISO646默认突出显示

解决方案

我不会使用替代运算符

如果我看到一个字母名称,我期望一个命名空间,类,变量,函数或函数风格运算符 - 常见的操作符将我们直观地划分为序列。对于我来说,替代的风格不适合C / C ++世界。



此外,虽然Greg有点新C或C ++,很快 - 我没有问题在任何地方发现


leisure/curiosity question as implied in the title.

I personally prefer the new operators as to make code more readable in my opinion.

Which ones do use yourself? What is your reason for choosing one over the other one?

also Emacs highlights those operators differently so I get more visual feedback when looking at the screen. I know the old operators can be highlighted as well but the ISO646 highlighted by default

解决方案

I won't use the alternative operators as they cause more confusion then clearity in my opinion.
If i see an alphabetical name i expect a namespace, class, variable, function or a function style operator - the common operators divide this intuitively into sequences for me. The alternative style just doesn't fit into the C/C++ world for me.

Also, while Greg has a point regarding people new to C or C++, you get used to it pretty soon - i have no problems spotting ! anywhere.

这篇关于你使用哪些C ++逻辑运算符:和,或不是ilk或C风格运算符?为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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