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


当前回答

public static final void attachListener(Object listener) {

/* ======================= */

// This does nothing, continue searching

/* ======================= */

...

与听众一起痛苦!

其他回答

最初的《毁灭战士》拥有一个带有静态墙壁的引擎,但却不能移动;结果,所有的门都是垂直打开的;任何东西都不可能水平移动。当源代码发布后,我在查看代码时,在处理门的源文件中看到了这个,在一大块注释掉的代码的开头:

// UNUSED
// Separate into p_slidoor.c?

#if 0           // ABANDONED TO THE MISTS OF TIME!!!
//
// EV_SlidingDoor : slide a door horizontally
// (animate midtexture, then set noblocking line)
//
// (c) 2000 Applied Magic, Inc.
// Unauthorized use punishable by torture, mutilation, and vivisection.

啊,我一直很喜欢这个……

// *** AAAAAHAHAHAH!!  What is this??
// Empty constructor to satisfy the stupid compiler
 Public ServletHandlerClass () { } 

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

...

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

...