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


当前回答

从我最近从事的一个非常可爱的项目(是的,我承认,其中一些是我的,但我不会告诉你是哪个):

if(FAILED(hr))
{
    char fuck[256];
    sprintf(fuck, "GetBuffer() fucking fucked the fuck: %d", hr);
    MessageBoxA(0, fuck, fuck, MB_OK | MB_ICONERROR);
    return;
}


// This is for Chris, since he gets all hot and horny over "uint" instead of "unsigned int"
// ... or maybe he's just a lazy fuck. Who knows!?
using Ogre::uint; 
// movable texts, fucktory
MovableObjectTextFactory* m_pMovableObjectTextFactory;


// diarrhea... shitting CR from the string. complete run...

他的意思是,他将字符串通过回车分开来呈现。

// unlock shit (duh, this comment is useless)
pixelBuffer->unlock();


// :HACK: remove me after demo is shipped
Of course, it's still in there ;)


// it's 4am and I can't think of a decent error message.
// my lead just fell asleep at his desk, so I can't ask him.
// [name] went home because he didn't want to get divorced.
// and so it's little ol' me, sitting here, comin up with an
// error message for something that should never ever happen.
ASSERT0(in_len == max_in, "http://www.youtube.com/watch?v=oHg5SJYRHA0"); 


// you want hungarian, you GET hungarian!
for(int fcknglpidxcntvrI = 0; fcknglpidxcntvrI < len; fcknglpidxcntvrI++)


bool bKillSomethingAlive = false; // beating the dead horse instead

当然,我们也有很多有趣的表达“Hack”的方法:

// HACKOMATIC 
// HMM... HACKXOR?
// HACK'O'ROONY
// AR; yeah I know it's HACKsoup
// HACK SHOT! DOMINATING!
// HACK'KIDO
// HACKku. sepukku. harakiri. kamikaze. ninja.
// HACK'o'NEIL
// HACKsaw

其他回答

// All this code is yours, except gedit()...attempt no modifications there.

.class {border:1px solid gold;} /*我可怜这个傻瓜*/

来自一个显然在看巨蟒剧团的小伙子:

> //现在,for something完全 > // different: 类theLarch {

一些来自Linux内核的代码:

/* Sun, you just can't beat me, you just can't.  Stop trying,
* give up.  I'm serious, I am going to kick the living shit
* out of you, game over, lights out.
*/

-

/* 2,191 lines of complete and utter shit coming up... */

-

#if 0 /* XXX No fucking way dude... */
/* Hammer Time! */

我不知道为什么,也不知道他在写代码时是否穿着防撕裂尼龙降落伞裤