警告:Using ++ and -- is considered harmful

在Myeclipse 6.0的某个JS文件中看到这样的警告:Using ++ and -- is considered harmful

有点莫名其妙~

参考:http://www.myeclipseide.com/PNphpBB2-viewtopic-t-10602.html

http://yehudakatz.com/2010/08/21/using-considered-harmful-or-whats-wrong-with/

其中有个人说的比较在理:

"The ++ (post-increment) and -- (post-decrement) operators have been known to contribute to bad code by encouraging excessive trickiness. They are second only to faulty architecture in enabling to viruses and other security menaces." This is a really, really dumb warning to have on by default. ++ and -- can be used to make tricky code. I almost invariably only use them in loop increments where they are not dangerous AT ALL. Someone's strange idea that they are so dangerous they should be flagged as warnings any time they are used anywhere is a very poor default.
引用:++和--操作容易产生错误的代码或者一些微妙而难以处理的情形。这些有缺陷的代码容易造成程序上的漏洞或一些其他安全性的问题。

Jacob([email protected])表示很无语~而且认为这样写一点问题都没有,但总有一些人说这是不合法的,应该加上警告无论何时使用。

你可能感兴趣的:(警告:Using ++ and -- is considered harmful)