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


当前回答

从C #

#region Hack - Shield Eyes Before Expanding

/// <summary>
/// A single uint with all of the bits set to represent the different tracing
/// </summary>
/// <remarks>
/// Ugly I know, so if you can think of a better way, feel free to rewrite.
/// </remarks>
[Browsable(false)]
public uint TraceBitfield
{
    // Snip
}

#endregion

其他回答

用于政府目的的企业等级系统中的评论

'RH 5/24/06 burn me if this dosn't work.. :)

好RH.....公司总裁/首席开发人员

前段时间我看到:

raise InvalidChild() # e.g. no legs

这很奇怪,因为“inwalida”在波兰语中是残疾人的意思。愚蠢的我:)

写得很好的Lisp是最容易阅读的语言之一,我喜欢它。但是写得不好的Lisp可能是比糟糕的Java更糟糕的噩梦,等等。

在这里,我们需要创建一个“组文件”,如果一个原始文件有3个变体,后缀为a, b和c。我一直试图追踪一个奇怪的错误,我们得到了不必要的组文件……

  (let ((varianta (format nil "~aa" problem))
        (variantb (format nil "~ab" problem))
        (variantc (format nil "~ac" problem)))
    ;;if the A and B variants exist, create a group file
    ;;(why not just check for a? I don't know, this just feels right)
    (when (and (probe-file varianta)
               (probe-file variantb))
      ...)))

Bug: 1, Gut: 0。

显然,写这篇文章的人没有想到,也许检查所有三种变体是一个好主意。当然,这是我在最初编写这段代码十年之后(它比第一个SVN日志更早)最终追踪到的错误。

[vrk:Cloud ID="cTags" runat="server" DataTextField="Tag" DataWeightField="Total"
    Width="100%" DataHrefField="Tag" DataHrefFormatString="~/tags.aspx?tag={0}"]
[/vrk:Cloud]

[!--if anybody would like to change the control's color contact with FLORJON--]
/*
    FIXME:  why the fuck did anyone ever think this kind of expensive iteration
                    was a good idea?