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


当前回答

/* This is O(scary), but seems quick enough in practice. */ 

后面是四个嵌套的for循环

其他回答

我没有亲身经历过这种情况,但这是一个很好的故事(详见我的评论中的解释):

#define MSGTAG_B33R     0x723 /* RIPLVB */
//open lid


//take sh!t


//close lid

文件打开,数据转储,文件关闭…

// StupidCompilerDontInline(SCDI), in the test project where
// allcode was in a single cpp the compiler had inlined nearly
// everything which lead to nice stackoverflow.
// To prevent this the metods are made virtual
#define SCDI virtual

下面是一个必须声明的局部变量,只是为了将一个常量传递给库函数:

// This only exists because Scott doesn't know how to use const correctly

我在重用我很久以前写的一个PHP类时发现了这一点。我仍然不记得那里有什么,我仍然发现它没有任何用处……我甚至不记得我写过那篇评论;所以当我找到它的时候,我真的笑出声来了。

try
{               
    // Some database logic
}
catch (Exception $ex)
{
    // sure, it looks silly and I honestly cant remember what code used to go here... but i swear i will
    // find a use for this code.... eventually....
    throw $ex;
}