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

在Myeclipse 6.0的某個JS文件中看到這樣的警告:Using ++ and -- is considered harmfulphp

有點莫名其妙~html

參考:http://www.myeclipseide.com/PNphpBB2-viewtopic-t-10602.html安全

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

其中有我的說的比較在理:ide

"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(jacob@well.com)表示很無語~並且認爲這樣寫一點問題都沒有,但總有一些人說這是不合法的,應該加上警告不管什麼時候使用。oop

相關文章
相關標籤/搜索