你遇到过的源代码中最好的注释是什么?


当前回答

来自一个显然在看巨蟒剧团的小伙子:

> //现在,for something完全 > // different: 类theLarch {

其他回答

// TODO - Comment this function
// error codes
#define ERROR_SUCESS 0
#define ERROR_SUCCESS_IS_MISSPELLED 1

没有定义其他错误代码。

// Any maintenance developer who can't quote entire Monty Python
// movies from memory has no business being a developer. 
const string LancelotsFavoriteColor = "$0204FB"
catch (Ex as Exception)
{
     // oh crap, we should do something.
}

没有什么比一个空的catch块更能让人觉得代码是健壮的....

我想我有过这样的经历:


if (case1) { // trivial
...
}
else { // we are screwed
 /* fill in later */
}

好吧,我可能用了一个比搞砸更强烈的词