你遇到过的源代码中最好的注释是什么?
当前回答
很久以前,我遇到了一些连接脚本,虽然我不记得语法,但我记得注释,因为我是平克·弗洛伊德的粉丝。
//Attempt Handshake: Hello? This is London calling. Are we reaching you?
//Handshake Failed: I don't understand...he just hung up.
其他回答
catch (Ex as Exception)
{
// oh crap, we should do something.
}
没有什么比一个空的catch块更能让人觉得代码是健壮的....
我在一家大型投资银行看到,该银行要求记录和评论所有应用程序中断
Without a crash
Or mighty bang
The sync disk
Did it's process hang
在makefile中找到这个
# ===== Never edit below this line. Ever. Or I'll kick your ass. ====
//There can Only Be one HIGHLAN....err..Singleton
public class SomeSingleton
{
...
}
这是众所周知的,但我喜欢它(在sys/ufs/ufs_vnops.c中):
/*
* A virgin directory (no blushing please).
*/
在FreeBSD内核源代码树中(甚至在之前,回到4.xBSD)