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


当前回答

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

...

// 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;

...

其他回答

// Bad Christian, No cookie

这里的Cookie不是指浏览器Cookie

// sometimes I believe compiler ignores all my comments

我刚刚注意到自己在写这个

// not brilliant solution, but fair enough heh.

从Joomla !来源:

// fudge the group stuff

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

if (/*you*/ $_GET['action']) { //celebrate