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


当前回答

我看到有人对代码的评论:

// This comment is self explanatory.

我猜他是想说“可变的”,但这个错误造成了一个有趣的评论……想想这里的循环逻辑,以及写它的徒劳。

其他回答

// TODO: Drive an ashen stake through the foul heart of this function.

这是一个糟糕的函数。直到今天我还在做噩梦。

-- Beyond this point, there'll be dragons

我觉得更长的说法^^更能说明问题

/* My lawyer told me not to reveal */

我不止一次使用过这个方法,当我对一个数学公式做了一些不明显的简化时,我不想记录:

//this formula is right, work out the math yourself if you don't believe me
$this->getSelect()->where ('main_table.product_id = -1'); // Mom, Dad... sorry