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


当前回答

// A Gorgon class - For the love of Zeus don't look directly at it!

其他回答

用VB写的很好。我今天早上跑进了NET,得到了一个笑声…

''' <summary>
''' Represents an exception that was logged.  Since System.Exception implements IDictionary, it can't be
''' serialized, so I had to write this.  Pretty fucking stupid thing to have to do, System.Exception should
''' be serializable right out of the box, IMHO.
''' </summary>
''' <remarks></remarks>
Public Class LogException

在中间几千行JScript文件后完全任意行…

// The world is a happy place.

当被问及什么是“最好的评论”时,我们的回答都是我们能找到的最糟糕的评论,这充分说明了我们的职业……

场景一:

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
);
// Added because boss changed his mind : 20020111,20020501,20020820, ...
// Commented out because boss changed his mind : 20020201,20020614,20020908, ...

在ETL脚本之间的主要黑客RPG数据库和SQL Server一个。我大概有10到20次这样的评论……