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


当前回答

/**
 * Always returns true.
 */
public boolean isAvailable() {
    return false;
}

永远不要依赖评论……

其他回答

Get This hack!

在一行汇编代码中,在几页未注释的代码之后。

来自Linux内核源代码:

linux /包括/ asm-i386 / hw_irq。h:

/*
 * subtle. orig_eax is used by the signal code to distinct between
 * system calls and interrupted 'random user-space'. Thus we have
 * to put a negative value into orig_eax here. (the problem is that
 * both system calls and IRQs want to have small integer numbers in
 * orig_eax, and the syscall code has won the optimization conflict ;)
 *
 * Subtle as a pigs ear.  VY
 */

我的精选集:

// Thats the end of the While loop
// Clean up last row.  I really must program better than this.

// Note: You can't immediately tell if the line below works.

// Rounding - blech.  It's assumed that all .5s are rounded up.

// Sort out predictions first.  Seems like the right place for a prediction, 'first'.

// Let's interpret!
public boolean isDirty() {
    //Why do you always go out and
    return dirty;
}
'Major changes: Everthing! - Removed all Cornoud's code !