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


当前回答

在中间几千行JScript文件后完全任意行…

// The world is a happy place.

其他回答

以下注释来自我必须调试的一个旧项目:

//Haleluya i can go home!

这个我在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))

I was doing a database in Access, very simple thing - at least it was supposed to be at the start or I would have done it in Delphi. The client wanted to be able to get the customer info out of the database but they would not enter enough information to reliably identify the customer. I told them to use the phone number as the key as each customer (the way they worked, not for everyone) would have a different number. After a few frantic calls from them, (It's not working we can't enter the customer) I discovered that they were too lazy to look up the phone numbers from their old system and were trying to enter all the numbers they did not know as "n/a". In trying to sort this out for them I ended up with a lot of checking loops in the code and had the comment beside one outcome "This should never be reached if they do what they are supposed to do!!!!!!!!!"

他们还曾经问过我:“即使我们输入了错误的地址,我们如何才能找到正确的客户?”而这一切都是为了花生。

// Fuck.

,……

// This code worked before, but my cat decided to take a trip across my keyboard...
def leppard
# what, i cant have my own convention?
end