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


当前回答

几年前我在。h文件里看到的。

// It may be a hack, but it works.

其他回答

// error codes
#define ERROR_SUCESS 0
#define ERROR_SUCCESS_IS_MISSPELLED 1

没有定义其他错误代码。

前段时间我看到:

raise InvalidChild() # e.g. no legs

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

# Don use this. Never!
-- Comment this later

这是一个4000多行的PL/SQL过程的第2行。唯一的评论。手术已经进行了4年了,后来还是没来…

int MyFunction()
{
    // There once was a man named Dave
    int Result = 0;

    // Whose code just wouldn't behave
    MyObject *Ptr = new MyObject();

    // He left to go to a meetin'
    Result = Ptr->DoSomething();

    // And left his memory a leakin'
    return Result;
}

c++怎么样