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


当前回答

在大学的一次家庭作业中,一位老师特别坚决地要求我们注释代码:

//I wonder if she actually reads these.

当作业被返回时,在注释“是的,我愿意”旁边用红笔写着

其他回答

// This code sucks.

在makefile中找到这个

# ===== Never edit below this line. Ever. Or I'll kick your ass. ====

sqlite源文件顶部:

/*

** The author disclaims copyright to this source code.  In place of             
** a legal notice, here is a blessing:                                          
**                                                                              
**    May you do good and not evil.                                             
**    May you find forgiveness for yourself and forgive others.                 
**    May you share freely, never taking more than you give.

*/

我记不清了,大概是这样的:

Person p = new Person("John", "Doe", "male");
Collection women = new ArrayList();
women.insert(p.getTail());

这是肮脏的代码;)

// long live COM'n'Roll
public enum StatusCode
{
        //success codes
        S_OK                                            = 1,
        S_NONE                                          = 2,
        S_SQL_OPERATIONS_LISTS_EMPTY                    = 3,

        //error codes
        E_NO_MATCHING_END_FOUND                         = -1,
        E_SEQUENCE_NUMBER_NOT_FOUND_AT_BEGINNING        = -2,
        E_SEQUENCE_NUMBER_NOT_FOUND_AT_END              = -3,
        E_FORWARD_AND_BACKWARD_OPS_COUNT_DO_NOT_MATCH   = -4,
        E_FORWARD_AND_BACKWARD_IDS_DO_NOT_MATCH         = -5,
        E_IDS_DO_NOT_MATCH                              = -6
}