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


当前回答

回顾类中的旧代码很有趣……

    cardDeck.push_back(*(new card((rank)r, (suit)s)));  // Push each card onto the deck
                                                        // Temp. objects are overrated

在经历一些事情的时候,它让我希望我在凌晨4点随机编码的时候留下更多的评论……

其他回答

这是一个旧的IOCCC获奖条目,我不得不下载整个获奖档案——一个巨大的1.4 M——和grep的几个短语,我记得错了才找到它。

从语法上看,这可能不是注释。或许是这样。我还没想明白。它肯定没有注释分隔符,但也没有字符串分隔符。

C="Lint says "argument Manual isn't used."  What's that
mean?";

没有价格来猜测棉绒的产量。

对于好奇的人来说,这个条目在这里。

aComment = 'this is not aComment' # this is aComment
class T(object):
    def f(this):
        this is not aComment

我经常看到这种情况:

// TODO make this work
  rescue
    # silently, we fail
    # many validations fade
    # like tear drops in rain
  end

这只是众多案例中的一个……

} catch (PartInitException pie) {
    // Mmm... pie