你遇到过的源代码中最好的注释是什么?
当前回答
在LucasArts的电脑游戏《the Eidolon》(游戏邦注:这款游戏本身就很古怪)的源代码中可以看到……
// He's dead, Jim!
其他回答
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;
}
// Any maintenance developer who can't quote entire Monty Python
// movies from memory has no business being a developer.
const string LancelotsFavoriteColor = "$0204FB"
Catch (Exception e) {
//who cares?
}
一个可怕的解码补丁(意大利语翻译):
/**
*@return the value
*@param key: the id of the list of instruments
*@PS this function is a violation of all the laws of the
*software engineering,
*commons sense, highway code
*and ONU decision about the coding.
That sh*t...
*/
在头文件的顶部:
/* Project : XYZ (Please somebody shoot me!)
*
* File : $Id: defs.h,v 1.1 $
*
* Purpose : Create havoc rather than peace among many nations
*
* History : Back-ported changes that were not in CVS. Please somebody,
* shoot us and put us all out of our misery.
*/
“XYZ项目”(已改名)是一个长达七年的折磨。最后这句话是由一个从头到尾都参与其中的坚定的灵魂写的。