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


当前回答

public int hashCode() {
//sucks, but what're you gonna do

/*
int hash = 7;
for (int i = 0; i < array.length; i++)
    hash = hash * 31 * (null == array[i] ? 0 : array[i].hashCode());
return hash;
*/

return 0;
}

其他回答

//Not a bug, parameter position can change..., if you think this is wrong, you are in fact wrong.

我不止一次使用过这个方法,当我对一个数学公式做了一些不明显的简化时,我不想记录:

//this formula is right, work out the math yourself if you don't believe me

这是显而易见的?

/** Logger */
private Logger logger = Logger.getLogger();
switch(value)
{
   [...]
default:
   ASSERT(**true**); // if this is triggered, something really bad is happening.
}