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


当前回答

这是我最喜欢的评论。

/// I intend to do this as shittily as possible because there are many better products that will totally blow this out of the water
/// and we don't have them so whatever

在后面的文件中,我们有更多的乐趣

/// sidestep a bug in WCF (that we can't send types across)
/// or, depending on how you look at, this issue is a Feature

稍后再讲

if( where == null)//be nice

其他回答

我刚刚完成了一个日志框架(使用Trace,为什么没有这样的存在我不知道)。我做了一个继承自TraceListener的方便基类。它覆盖了所有的TraceListener方法,并将它们路由到一个方法中——因此有很多文档注释:

// TODO: Need some codemonkey to doc comment this class.
// This code was written by a genius so don't try to understand it with
// your tiny little brain.
Get This hack!

在一行汇编代码中,在几页未注释的代码之后。

大概30页的xslt的中间部分

<!-- Here be dragons  -->
THIS PROGRAM HAS CODE THAT DOES NOT MEET STANDARDS      

这个评论几乎出现在我们这里的每一个节目中....