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


当前回答

我前几天刚检查过这个…

/// <STERNLY-WORDED-WARNING>
/// Pay attention to this or I will hunt you down.
/// ...
/// </STERNLY-WORDED-WARNING>

(“……”== "专有的东西,我不能发布")。我只是喜欢我的措辞严厉的警告元素。

其他回答

// The freshest corpse at the back please.
m_DeadCharacters.push_back( std::make_pair(character, 0.0f) );
// Get rid of the rotting surplus
while( m_DeadCharacters.size() > 3 )
    m_DeadCharacters.pop_front();
// TODO: Drive an ashen stake through the foul heart of this function.

这是一个糟糕的函数。直到今天我还在做噩梦。

//too much log will kill you

这个评论是我自己写的,当降低一些日志的优先级时,否则会写数百MB的垃圾,严重削弱应用程序的性能。

我最近看到了这个:

//你刚刚输了比赛

如果你不知道游戏是什么: http://en.wikipedia.org/wiki/The_Game_ (mind_game) (这很傻,但在某种程度上很有趣)

我发现了这个

// This is a kind of magic...