你遇到过的源代码中最好的注释是什么?
当前回答
刚从大学毕业的我渴望亲自动手。我的第一个任务是……“为我注释此代码”。
傻瓜。
过了一段时间我就厌倦了……
// this function doesn't actually calculated the profit, like it says --it really signals the mothership orbiting saturn that the planet is ripe for takeover
[later]
// I don't think anyone is going to read this
[various permutations on that last one]
其他回答
var something TBoolean; //Pickins
//MailBody builders for two outgoing messages
StringBuilder hanz = new StringBuilder();
StringBuilder franz = new StringBuilder();
当我读到这篇文章时,我仍然会笑出声来……
// fix for groupid > 9
// if groupid ever gets to 100 everything will break (again)
if (groupid < 10) {
groupid = "0" + groupid;
}
一段时间前我在一个PHP CMS中添加的注释。
if (/*you*/ $_GET['action']) { //celebrate
我经常看到这种情况:
// TODO make this work