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


当前回答

   // Some wanker in ISO got rid of ifstream(int), ofstream(int), and
   // fstream(int).  Twit.

其他回答

我想我有过这样的经历:


if (case1) { // trivial
...
}
else { // we are screwed
 /* fill in later */
}

好吧,我可能用了一个比搞砸更强烈的词

经典的旧netscape mozilla代码。我个人喜欢

就是不能乱来。而且移动记忆会毁了我们,还有 一切都太他妈难搞清楚了。所以,我放弃了,Mac 完全完全地吸走完整的岩石

但还有很多其他有趣的。

// set break point here - you'll never reach it

为什么你不应该将你的软件开发外包的一个经典案例:

public class Contact
{
    //...    

    /// <summary>
    /// Gets or sets the name of the first.
    /// </summary>
    /// <value>The name of the first.</value>
    public string FirstName
    {
        get { return _firstName; }
        set { _firstName = value; }
    }
}

唐纳德·克努斯的另一个经典作品:

注意上面代码中的bug; 我只是证明了它是正确的,并没有尝试过。