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


当前回答

// for 8 or 12 threads this does not affect much.
// Strange are the situations if not understood properly.
// Yoda strikes again

在多线程模块中!:)

其他回答

//        .==.        .==.          
//       //`^\\      //^`\\         
//      // ^ ^\(\__/)/^ ^^\\        
//     //^ ^^ ^/6  6\ ^^ ^ \\       
//    //^ ^^ ^/( .. )\^ ^ ^ \\      
//   // ^^ ^/\| v""v |/\^ ^ ^\\     
//  // ^^/\/ /  `~~`  \ \/\^ ^\\    
//  -----------------------------
/// HERE BE DRAGONS

我没有原始文件的权限,因为我已经不在那里工作了,但它和这张照片非常相似。它位于文件的顶部,总是会引起麻烦,我们必须修复,但不允许花时间真正修复。(大学政治)

try {
  dataSource.close();
}
catch (SQLException ex) {
  // Do nothing, since we're going to trash this anyway
}

当然,这类事情实际上是JDBC(或者至少是Oracle的JDBC驱动程序)中的wtf,因为它可以在关闭连接时抛出SQLExceptions…

// I dedicate all this code, all my work, to my wife, Darlene, who will 
// have to support me and our three children and the dog once it gets 
// released into the public.

来自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

不是一个评论,而是一个goto标签

ICantBelieveImUsingAGoto: