2009-10-02 79 views
1

工作在一个经典的VB6应用程序,数千人的疯狂评论。如何处理荒谬的评论?

实施例:

If garrFilePaths(i).FilePath = "" Then
'do nothing
Else
MsgBox "File Not Found (" & garrFilePaths(i).FilePath & ")", vbOKOnly, gcstrMessageBoxTitle
End If

+5

什么问题又来了? – 2009-10-02 12:27:08

+0

关闭这个问题的人可能已经散布了这个应用程序的评论 – user52212 2009-10-02 12:43:41

回答

2
If garrFilePaths(i).FilePath = "" Then 
'do nothing 'fool 
Else 
MsgBox "File Not Found (" & garrFilePaths(i).FilePath & ")", vbOKOnly, gcstrMessageBoxTitle 
End If 
+0

EPIC !!!!就在!经典 – user52212 2009-10-02 12:33:30

2

重构因此是很有意义。 “处理”不是很多,只是删除cruft,所以你不必花费大脑周期。

也许与编写它的开发者交谈,和/或致力于指导文档(编码标准)以帮助人们做正确的事情。

5

重构代码并将其删除。

If Not (garrFilePaths(i).FilePath = "") Then 
    MsgBox "File Not Found (" & garrFilePaths(i).FilePath & ")", vbOKOnly, gcstrMessageBoxTitle 
End If 

这通常适用于评论认为有意义了。

+0

这是一段时间,因为我做了基本,但我认为这可能是garrFilePaths(i).FilePath <>“”。 – legoscia 2009-10-02 12:28:07

+0

@legoscia:对我来说也是一段时间,但我认为这些都是等同的陈述。 – 2009-10-02 12:29:16

+0

@legoscia:是的,我刚刚证实,这将是等效的语法。 http://msdn.microsoft.com/en-us/library/2hxce09y.aspx我花了很长时间才弄清楚如何搜索'''''。 :) – 2009-10-02 12:36:30

2

/* * 无可奉告 */

+2

'没有评论,当然? – wefwfwefwe 2009-10-02 12:39:15