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


当前回答

从2004年的Windows泄露事件来看,

__inline BOOL
SearchOneDirectory(
                  IN  LPSTR Directory,
                  IN  LPSTR FileToFind,
                  IN  LPSTR SourceFullName,
                  IN  LPSTR SourceFilePart,
                  OUT PBOOL FoundInTree
                  )
{
    //
    // This was way too slow. Just say we didn't find the file.
    //
    *FoundInTree = FALSE;
    return(TRUE);
}

其他回答

catch (Exception ex)
{ 
    // just die already.
}

在一个生成HTML的旧perl脚本中找到:

# I would be _very_ brain farting if I said this code didn't need reviewing.
# It will make babies cry, and hair grow on your back, so please don't use it

我曾经在一个项目中发现了这样的评论:

// Cabbage fart?

我不知道那是什么意思。还好我的魔方不在写它的人旁边。

从http://www.madore.org/ ~大卫/电脑/ callcc.html:

/* Yow!  DEMONS are flying through my NOSE! */

有一次,我在另一个讨论中看到这样的内容:

// I can't divide with zero, so I have to divide with something very similar
result = number / 0.00000000000001;

聪明的解决方案,不是吗?(如果有人不确定,这就是个笑话)