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


当前回答

//If only humans could leave things be.

//Please do not edit this code, 
//if you do you wont go to jail, you wont go directly to jail, 
//you wont pass go, you wont collect 200 dollars

其他回答

从泄露的Win2K源代码:

//这次黑客入侵的规模堪比国家债务的规模。

我发现了这个:

I'm not sure what I did
if(count<0) count=0;    //don't get me wrong but this has to be done :p

一个文件中5000多行代码中很少的一些注释 事实上,我和那个为自己的编码风格辩护的程序员有过一次争论…… 无可奉告! 没有评论;-)(或者很少) 遗憾的是,这是产品代码。

offset=1;
for (i=0;i<=len;i++)
    {
    if ((i!=0)&&(i<len)) //-3
        {
        switch(mess[i])
            {
            case ETX:
            case ETB:
            case DLE:
                buf[offset]=DLE;
                offset++;
                break;
            }
        }
    buf[offset]=mess[i];
    offset++;
    }

我喜欢这个开关!

for (n=0;n<offset;n++)
{
    Sleep(TR);  //Modif A
    Sleep(T);//
    FWriteFile(hCom,buf+n,1,&dwMot,NULL);
    if (ECHO)
        FReadFile(hCom,tab,1,&dwMot,NULL);
}

不,没有注释解释什么“修改A”是在标题。

if (GetFileSize(hSlotFile,NULL)==3600)   //5*720

720是多少?

i++; // increment variable i