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


当前回答

有一次,我问一个同事如何用我们的内部框架做一些事情(忘了具体是什么,一些晦涩的技术调用)。 他说“简单,看这里”,然后在他的编辑器中打开一个。java文件,在几页代码中间给我看了这个注释:

// HERE

我刚刚检查了一下,注释仍然在这个文件中:)

其他回答

// Caveat implementor

一段时间前我在一个PHP CMS中添加的注释。

if (/*you*/ $_GET['action']) { //celebrate
//I am not sure why this works but it fixes the problem. 

这是之前的一组代码,技术上确实解决了问题,它的意思是,但打破了其他3个东西....

//When I wrote this, only God and I understood what I was doing
//Now, God only knows
options.BatchSize = 300; //Madness? THIS IS SPARTA!