应避免条件分配 [英] Assignments in conditions should be avoided

查看:69
本文介绍了应避免条件分配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚从phpdesigner切换到Netbeans作为我的脚本编辑器。

Netbeans用这个警告批评我的代码

I have just switched from phpdesigner to Netbeans as my script editor.
Netbeans is criticising my code with this warning


可能意外分配,条件中的分配应该避免
Possible accidental assignment, assignments in conditions should be avoided



例如,你对这个警告的看法是什么?

What is your opinion of the warning when doing this for example?

展开 | 选择 | Wrap | 行号

推荐答案

@code green


我不喜欢不知道为什么会抱怨但是......


我的组织坚持要用这种方式编写代码。
@code green
I don''t know why it complains but.....

My organization insist me to write code in this way.
展开 | 选择 | Wrap | 行号


我不知道这个问题,但我的组织有一些编码标准,就此而言。


如果我尝试编写代码

I dont know about that problem, but my organization has some coding standards, as per that.

If i try to write code as

展开 | 选择 | Wrap | 行号


我有一个谷歌,似乎这背后的原因是避免混淆
I have had a Google and it seems the reasoning behind this is to avoid the schoolboy error of confusing
的男生错误展开 | 选择 | 换行 | 行号
Expand|Select|Wrap|Line Numbers


这篇关于应避免条件分配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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