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


当前回答

if(count<0) count=0;    //don't get me wrong but this has to be done :p

其他回答

Tweet tweet = (Tweet) tweets.get(i); // Poetic.

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

        /*
         * 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?
        }

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

# Don use this. Never!

这是我今天重构一些代码时发现的一条评论

if( year < 100 ): year += 2000 #lol, Y2K
// Sorry dirty code