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


当前回答

这个我在Python 2.5的“twisted”包中找到的(文件是tcp.py在第371行)

# Limit length of buffer to try to send, because some OSes are too
# stupid to do so themselves (ahem windows)
return self.socket.send(buffer(data, 0, self.SEND_LIMIT))

其他回答

// TODO: not this

上面写了一个同事迫切需要优化的查询。替他说句话,当时我们几个月都是每周工作70个小时……

//The following code is commented out
//(a load of commented out code followed)
// this error could never happen

然后,客户打电话说他看到一条错误消息说"这个错误永远不会发生"

// Catching exceptions is for communists

来自Mike Duncan在SQLite上的页面。

//Please comment on your source code