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


当前回答

在一个项目中,我们有一个依赖ppwlib,当时它的FreeBSD端口有点糟糕,所以我不得不从源代码手动构建它。但它并没有立即起作用,我不得不研究代码;有一些复杂的类层次结构,部分代码是由宏生成的,其父类声明以它们开始

// The root of all evil ... umm classes

其他回答

# Don use this. Never!

不是注释,而是属性

[ThereBeDragons]

还有一个是我在IHttpHandler的实现中看到的

//What is this?
public bool IsReusable
{
    get{return false;}
}
//Woulda
if(x) {}
//Shoulda
else if(y) {}
//Coulda
else {}

sqlite源文件顶部:

/*

** The author disclaims copyright to this source code.  In place of             
** a legal notice, here is a blessing:                                          
**                                                                              
**    May you do good and not evil.                                             
**    May you find forgiveness for yourself and forgive others.                 
**    May you share freely, never taking more than you give.

*/
  mov si, pCard      ; captain?