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


当前回答

 * ...and don't just declare it volatile and think you've solved
 * the problem. You young punks think you know what volatile
 * means... why in my day we had to cast it volatile uphill
 * both ways, and the code still didn't work! Whippersnappers...

其他回答

从泄露的Win2K源代码:

//这次黑客入侵的规模堪比国家债务的规模。

//Please comment on your source code
#ifdef TRACE
#undef TRACE     /* All your trace are belong to us. */
#endif
#define TRACE ....

我不知道这是有趣还是悲伤..但是和我一起工作的一个实习生有这个小宝石来计算每个单位的价格

...

// get the units from the form 
int numUnits = Integer.parseInt(request.getParameter("num_pieces")); // this break at random times

//price 
float price = Float.parseFloat(request.getParameter("price")); // same as above

// Under certain conditions the following code blows up. I don't know those conditions.
float pricePerUnit = price / (float)numUnits;

...

//我知道这很让人困惑,所以让我解释给你听。