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


当前回答

Dennis M Ritchie在这里有一个关于一些古老UNIX注释的页面

其他回答

比起评论,我真的更喜欢oh_my_god标签…

    /*
     * IOC3 is fucked fucked beyond believe ...  Don't even give the
     * generic PCI code a chance to look at it for real ...
     */
    if (cf == (PCI_VENDOR_ID_SGI | (PCI_DEVICE_ID_SGI_IOC3 b_type0_cfg_dev[slot].f[fn].c[where ^ (4 - size)];

    if (size == 1)
        res = get_dbe(*value, (u8 *) addr);
    else if (size == 2)
        res = get_dbe(*value, (u16 *) addr);
    else
        res = get_dbe(*value, (u32 *) addr);

    return res ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;

oh_my_gawd:

    /*
     * IOC3 is fucked fucked beyond believe ...  Don't even give the
     * generic PCI code a chance to look at the wrong register.
     */
    if ((where >= 0x14 && where = 0x48)) {
        *value = 0;
        return PCIBIOS_SUCCESSFUL;
    }

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

if (/*you*/ $_GET['action']) { //celebrate
long john; // silver
//Not a bug, parameter position can change..., if you think this is wrong, you are in fact wrong.
catch (Domain.ConcurrencyException)
{
    // somebody changed it between the time we loaded it and now.
    // weird, huh?
}