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


当前回答

# There is a bug in the next line.  $searchParameters != {} will always return true, because {} is creating
# a new hash reference on the fly, and the inequality operater is comparing the memory location of it
# to the memory location of $searchParameters, and they will always be different. 
# This means that the following code will always get executed as long as $nodes is defined.
# I'm leaving it there because it has always been there, and although I'm sure it was originally meant to
# mean %$searchParameters (essentially "is this hash not empty"), I'm afraid to change it.
if ( $nodes && $searchParameters != {} )
{

其他回答

这似乎阻止了白痴搞砸我的代码…

// Autogenerated, do not edit. All changes will be undone.
// 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();
// Hack-er-ama
$this->getSelect()->where ('main_table.product_id = -1'); // Mom, Dad... sorry
// this error could never happen

然后,客户打电话说他看到一条错误消息说"这个错误永远不会发生"