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


当前回答

以下注释来自我必须调试的一个旧项目:

//Haleluya i can go home!

其他回答

// Oh crap, i think i'm gonna yack

随后不久又有:

// TODO: end this lunacy
public GetRandomNumber()
{
    // Chosen by a fairly rolen dice
    return 12;
}

我经常看到这种情况:

// TODO make this work

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

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; }
    }
}
//ALL YOUR BASE ARE BELONG TO US

...这让我的老板以为有人黑进了系统。他不知道这个笑话。