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


当前回答

来自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
 */

其他回答

目前为止最好的一个:

"This code makes baby Jesus very sad!". 

它像这样引用一个String的初始化:

String blankSpaces="                              "+ //100 whitespaces
                   "                              "+ //200 Whitespaces
                   ...
                   "                                        " //100 whitespaces

你懂的。

来自嵌入式系统中的电池监测模块:

// batmon.c drives the rastamobile

消毒:

//Forward declarations:

class X {}; // TODO: Remove {}  ! When we get X defined....
// StupidCompilerDontInline(SCDI), in the test project where
// allcode was in a single cpp the compiler had inlined nearly
// everything which lead to nice stackoverflow.
// To prevent this the metods are made virtual
#define SCDI virtual
// drunk, fix later

真希望我是在开玩笑。根据编写代码的开发人员的了解,我认为他是认真的。