你遇到过的源代码中最好的注释是什么?
当前回答
这似乎阻止了白痴搞砸我的代码…
// Autogenerated, do not edit. All changes will be undone.
其他回答
整个函数非常棒(来自Linux的sunhme.c驱动程序,用于被Sun戏称为“快乐套餐”的网卡)。因为在那之前的卡片是“巨无霸”。明白了吗?明白了吗?)
static void happy_meal_tcvr_write(struct happy_meal *hp,
void __iomem *tregs, int reg,
unsigned short value)
{
int tries = TCVR_WRITE_TRIES;
ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value));
/* Welcome to Sun Microsystems, can I take your order please? */
if (!(hp->happy_flags & HFLAG_FENABLE)) {
happy_meal_bb_write(hp, tregs, reg, value);
return;
}
/* Would you like fries with that? */
hme_write32(hp, tregs + TCVR_FRAME,
(FRAME_WRITE | (hp->paddr << 23) |
((reg & 0xff) << 18) | (value & 0xffff)));
while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries)
udelay(20);
/* Anything else? */
if (!tries)
printk(KERN_ERR "happy meal: Aieee, transceiver MIF write bolixed\n");
/* Fifty-two cents is your change, have a nice day. */
}
//open lid
//take sh!t
//close lid
文件打开,数据转储,文件关闭…
Dennis M Ritchie在这里有一个关于一些古老UNIX注释的页面
//休斯顿,我们有麻烦了
我相信在JBoss的某个地方有一行写着
return null; //Not really null
我一直很喜欢这句话。