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


当前回答

/*这是一个可怕的黑客攻击的副本——很多年前,遗留的PortfolioServer被修改为在“optionTrade”块中返回现金交易,因为客户端开发人员太懒了,没有正确地获取他们的xpath。他们的懒惰一直在回响,这意味着我们在这里需要一个类似的黑客……*/

其他回答

//这将为我们每个用户节省0.5秒,并取悦机器精神。

在很长的程序之前:)

try {

}
catch (SQLException ex) {
    // Basically, without saying too much, you're screwed. Royally and totally.
}
catch(Exception ex)
{
    //If you thought you were screwed before, boy have I news for you!!!
}
/* FIXME This must absolutely be removed before 4.0.7 release
 * TODO really remove this */

我们已经发布了4.0.7,4.0.8,4.0.9和4.1版本…

我只是在我自己的代码中遇到了这个问题。它在一个用于类别选择的洋红色管理模板中:

        /*
         * OK; before you read the following code know what I am trying to do.
         * I needed to get the list of child catagories from the root node so that
         * the root node didn't appear in the selection box. But for some stupid
         * fucking reason the stupid fucking DBA wont let me access the items using
         * indicies and I instead have to use their stupid fucking Iterator
         * implementation. So there.
         */
        $firstList = $this->getRootNode()->getChildren();
        foreach ($firstList as $node)
        {
            $nodes = $node->getChildren();
            break;          // wtf?
        }

我要把语言从我们的旗舰产品中移除;但我记得我非常沮丧。如果我没有留下评论,我会试着修改它,但会遇到和以前一样的问题。

// TODO: Drive an ashen stake through the foul heart of this function.

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