你遇到过的源代码中最好的注释是什么?
当前回答
在一个名为“Bar”的类中(这是一个不具有描述性名称的UI控件),类头文件:
/// <summary>I pity the "foo".</summary>
Remove()方法:
/// <summary>A "foo" and his money are soon parted.</summary>
更糟糕的是,业务合作伙伴从生成的文档中指出了这一点。更糟糕的是,这些可能是我们从那家伙那里得到的最接近有用文件的东西。
其他回答
// this is really complicated
没有其他评论了
我的精选集:
// Thats the end of the While loop
// Clean up last row. I really must program better than this.
// Note: You can't immediately tell if the line below works.
// Rounding - blech. It's assumed that all .5s are rounded up.
// Sort out predictions first. Seems like the right place for a prediction, 'first'.
// Let's interpret!
/* My lawyer told me not to reveal */
在被迫为贫血域对象编写单元测试时,这些对象不过是getter和setter的包(我也是被迫写的):
// zzzzZZZZzzzz....
//把这个放在这里的人是个白痴…这根本不管用!
但是代码还在那里……