使用经典的VB6应用程序,成千上万的疯狂评论。
示例:
If garrFilePaths(i).FilePath = "" Then
'do nothing
Else
MsgBox "File Not Found (" & garrFilePaths(i).FilePath & ")", vbOKOnly, gcstrMessageBoxTitle
End If
答案 0 :(得分:5)
重组代码并删除它们。
If Not (garrFilePaths(i).FilePath = "") Then
MsgBox "File Not Found (" & garrFilePaths(i).FilePath & ")", vbOKOnly, gcstrMessageBoxTitle
End If
这通常适用于做也有意义的评论。
答案 1 :(得分:2)
重构所以它是有道理的。 “处理”并不是很多,只需删除它,这样你就不必花费大脑周期了。
或许与编写它的开发人员交谈,和/或处理指导文档(编码标准)以帮助人们做正确的事情。
答案 2 :(得分:2)
If garrFilePaths(i).FilePath = "" Then
'do nothing 'fool
Else
MsgBox "File Not Found (" & garrFilePaths(i).FilePath & ")", vbOKOnly, gcstrMessageBoxTitle
End If