What is the best comment in source code you have e

2018-12-31 09:38发布

What is the best comment in source code you have ever encountered?

标签: comments
30条回答
浮光初槿花落
2楼-- · 2018-12-31 10:11
// somedev1 -  6/7/02 Adding temporary tracking of Login screen
// somedev2 -  5/22/07 Temporary my ass
查看更多
冷夜・残月
3楼-- · 2018-12-31 10:11

#define TRUE FALSE //Happy debugging suckers

查看更多
其实,你不懂
4楼-- · 2018-12-31 10:11
    #Christmas tree initializer  
    toConnect = []  
    toRead =   [  ]  
    toWrite = [    ]   
    primes = [      ]  
    responses = {}  
    remaining = {}  
查看更多
还给你的自由
5楼-- · 2018-12-31 10:12

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
// 
查看更多
临风纵饮
6楼-- · 2018-12-31 10:12
//When I wrote this, only God and I understood what I was doing
//Now, God only knows
查看更多
若你有天会懂
7楼-- · 2018-12-31 10:12
stop(); // Hammertime!
查看更多
登录 后发表回答