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


当前回答

//open lid


//take sh!t


//close lid

文件打开,数据转储,文件关闭…

其他回答

我最喜欢的是已故的Paul DiLascia:

//作者:如果这段代码工作,它是由Paul DiLascia写的。如果不是,我就不知道是谁写的了。

场景一:

return 0; // Happy ending

场景二:

int32_t Interpolate1DSignal(
  Array1D<float64>::Handle hfInputSamples,         // samples to be interpolated
  Array1D<float64>::Handle hfInterpolationFilter,  // polyphase filter coefficients,
  int32_t iFilterInterpolationFactor,              // # of "rows" in polyphase filter
  int32_t iFilterLength,                           // Length of each row in filter
  float64 fInterpolationFactor,                    // Factor to interpolate the
                                                   // signal by
  float64 fTimingOffset,                           // Offset into the signal (units   
                                                   // of samples)
  Array1D<float64>::Handle hfOutputSamples         // left as an exercise for the reader
);

这是在PHP代码中找到的

$s=2; // chicken and bacon wrap for lunch

多么有用,幸运的是$s是不言自明的

消毒:

//Forward declarations:

class X {}; // TODO: Remove {}  ! When we get X defined....

大概30页的xslt的中间部分

<!-- Here be dragons  -->