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


当前回答

好吧,这些是我的,所以WTF是我,正如CodingHorror所说:

//#region Code for weird cases - do you really want to know?

我曾经在一些ASP中留下了这样的评论:

' Commented out following code, don't delete for when [CustomerName] changes his mind

碰巧,[CustomerName]没有改变他的想法,但他确实有访问web服务器,他确实找到了那行…

其他回答

这是我们在大学宿舍使用的自定义DHCP服务器,根据它们是否注册/安装补丁和防病毒,将计算机放入“干净”或“脏”IP地址池:

public boolean getDirty (String MAC) // not as fun as it sounds

//你不需要理解这个

经典。

// The ratio of a circle's circumference to its diameter.  Remember to change
// this to 3.0 if you move to a site in Indiana.

#define Pi                                      3.1415927
 // WARNING!!!
 // Very perversive code ahead!

... about a 20 lines of "very perversive" code ...

// Now you can call your grandmother back. ;)

今天刚加了这个:

// Hardcoded this for time sake ... will make andrew fix later :)