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


当前回答

事实上,有一天我在一些代码上看到了这个,这些代码是在截止日期很急的时候写的。

//This was clearly written under duress

其他回答

// TODO: Finish.
// Catching exceptions is for communists

来自Mike Duncan在SQLite上的页面。

我曾经参与过Windows 3.0的源代码。(我赶紧补充一句,作为一名微软员工,不是!)在那里,我遇到了一个文件加载器,它可以多次重新输入,并且有一个讨厌的双关语的例子(只是为了显示作者有多聪明)。

这些乱七八糟的可重入代码是用Intel程序集jmp指令(在C代码中间)执行的,它的标签是“we_are_not_in_kansas_any_more_toto”。

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

从C #

#region Hack - Shield Eyes Before Expanding

/// <summary>
/// A single uint with all of the bits set to represent the different tracing
/// </summary>
/// <remarks>
/// Ugly I know, so if you can think of a better way, feel free to rewrite.
/// </remarks>
[Browsable(false)]
public uint TraceBitfield
{
    // Snip
}

#endregion