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


当前回答

// No women, no children... What movie???

其他回答

我一直很喜欢Paul DiLascia在他的文件头中写的:

// If this code works, it was written by Paul DiLascia. If not, I don't know
// who wrote it

以下注释来自我必须调试的一个旧项目:

//Haleluya i can go home!
// fix for groupid > 9 
// if groupid ever gets to 100 everything will break (again)

if (groupid < 10) {
groupid = "0" + groupid;
}

这是我自己代码中的一个,但它仍然非常有趣,我认为最好还是把它放在网上,因为它是在公共SVN中。

// These were orginally up and down. When it was clear the names were
// inapplicable, they were renamed to retain the joke.
// Sorry if you were hoping for useful variable names.
quantum strange, charm;

所有bug由David S. Miller添加