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


当前回答

很久以前,我遇到了一些连接脚本,虽然我不记得语法,但我记得注释,因为我是平克·弗洛伊德的粉丝。

//Attempt Handshake: Hello? This is London calling. Are we reaching you?


//Handshake Failed: I don't understand...he just hung up.

其他回答

我个人最喜欢的是打油诗形式的文档:

        Subclassing made Zope and TR
        much harder to work with by far.
            So before you inherit,
            be sure to declare it
        Adapter, not PyObject*

这可能会破坏这个笑话,但由于它有点晦涩,我将解释:

这里的TR指的是“扭曲的现实”。Zope 2和最初的扭曲。Reality包大量而不幸地使用了多重继承,这可能会使您在看到方法调用时难以理解发生了什么。Zope 3,扭曲自己,扭曲。现实的后继者(包括最近的假想)通常更倾向于组件组合。

这在我自己的代码中出现过几次。显然我摸了不止一次。

// TODO: Fix this.  Fix what?
private int mousycounter = 0; //Not really a counter
#pragma region Crap that is kept for temporary reasons

    //  Huge chunk of commented code

#pragma endregion

看这个:

'On Error Goto Hell.