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


当前回答

// The following strings are meant to be funny.  Do not edit these strings
// unless you are funny, too.  If you don't know if you're funny, you're
// not funny.  If fewer than 2 people unrelated to you have told you that 
// you're funny, you're not funny.

其他回答

来自c#中的单元测试类:

#region quis custodiet ipsos custodes?

[Fact]
public void TestPositive()
{
    Assert.Equal(4, 2 + 2);
}

[Fact]
public void TestNegative()
{
    Assert.Equal(5, 2 + 2);
}

#endregion
public static final void attachListener(Object listener) {

/* ======================= */

// This does nothing, continue searching

/* ======================= */

...

与听众一起痛苦!

catch (Domain.ConcurrencyException)
{
    // somebody changed it between the time we loaded it and now.
    // weird, huh?
}
-- Beyond this point, there'll be dragons

我觉得更长的说法^^更能说明问题

一段时间前我在一个PHP CMS中添加的注释。

if (/*you*/ $_GET['action']) { //celebrate