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


当前回答

//Maybe you should make anyone knows your code's purpose. 

其他回答

struct core_unlocker
{
    core_unlocker(lock)
    {
        m_lock = lock
        unlock(lock)  //Abandon All Locks, Ye Who Enter Core!
    }
    ~core_unlocker()
    {
        lock(m_lock)
    }  
    private:
    Corelock m_lock;
}
'Do not optimize these next two lines. Compiler bugs lurk.

他们做到了。将变量压缩到第二行表达式中会导致跳到堆中间并尝试执行数据。

v.bpc     := v.pc;  -- Remember to jump back
v.baccu   := accu;  -- Yo dawg, heard you like runing instructions
                    -- so I took backup of your accu so you can run
                    -- instructions while you run instructions.
v.flags.i := false; -- No more interupts
-- Change Log:  Not needed. The code is perfect 'cause I wrote it.
-- If you change it, it will break.

我正在检查一些代码注释,以检查它们是否有意义,并看到上面的一行。

这是在PHP代码中找到的

$s=2; // chicken and bacon wrap for lunch

多么有用,幸运的是$s是不言自明的