你遇到过的源代码中最好的注释是什么? [英] What is the best comment in source code you have ever encountered?
问题描述
您遇到的源代码中最好的注释是什么?
What is the best comment in source code you have ever encountered?
推荐答案
我特别内疚, - 建设性的评论,代码诗歌和小笑话进入我的大多数项目(虽然我通常有足够的感觉删除任何直接攻击,然后释放代码)。这里有一个我特别喜欢,远远落在一个设计糟糕的上帝对象:
I am particularly guilty of this, embedding non-constructive comments, code poetry and little jokes into most of my projects (although I usually have enough sense to remove anything directly offensive before releasing the code). Here's one I'm particulary fond of, placed far, far down a poorly-designed 'God Object':
/**
* For the brave souls who get this far: You are the chosen ones,
* the valiant knights of programming who toil away, without rest,
* fixing our most awful code. To you, true saviors, kings of men,
* I say this: never gonna give you up, never gonna let you down,
* never gonna run around and desert you. Never gonna make you cry,
* never gonna say goodbye. Never gonna tell a lie and hurt you.
*/
我很抱歉!!!我只是不能帮助自己.....!
I'M SORRY!!!! I just couldn't help myself.....!
另一个,我承认我没有真正释放到野外,即使我非常喜欢在我不太直观的课程中这样做:
And another, which I'll admit I haven't actually released into the wild, even though I am very tempted to do so in one of my less intuitive classes:
//
// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 42
//
这篇关于你遇到过的源代码中最好的注释是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!