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


当前回答

// barcore.cpp - MFC

//.....
HBRUSH CControlBar::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
    LRESULT lResult;
    if (pWnd->SendChildNotifyLastMsg(&lResult))
        return (HBRUSH)lResult;     // eat it

//......

// Eat it - just like eat this.

其他回答

// no comments for you
// it was hard to write
// so it should be hard to read

我告诉学员至少做一些异常处理。这是我在每一个db调用....返回

Catch (Exception e) {
    //eat it
}

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

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

If you have reached this part in the code, then this program sucks.

最初的《毁灭战士》拥有一个带有静态墙壁的引擎,但却不能移动;结果,所有的门都是垂直打开的;任何东西都不可能水平移动。当源代码发布后,我在查看代码时,在处理门的源文件中看到了这个,在一大块注释掉的代码的开头:

// UNUSED
// Separate into p_slidoor.c?

#if 0           // ABANDONED TO THE MISTS OF TIME!!!
//
// EV_SlidingDoor : slide a door horizontally
// (animate midtexture, then set noblocking line)
//