亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

這些奇趣的代碼注釋你見過嗎?

Stack Overflow 上有个关于你见过的最好(gao)的注释的帖子:What is the best comment in source code you have ever encountered?

摘录其中一部分贴出来:

脑洞大开

/**
* 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.
*/


历史的教训

// 
// 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
//


忠告

/*
 * You may think you know what the following code does.
 * But you dont. Trust me.
 * Fiddle with it, and youll spend many a sleepless
 * night cursing the moment you thought youd be clever
 * enough to "optimize" the code below.
 * Now close this file and go play with something else.
 */



“哈哈”太贱了

Exception up = new Exception("Something is really wrong.");
throw up;  //ha ha


这条我忍不住笑了

//When I wrote this, only God and I understood what I was doing
//Now, God only knows


这条适合处女座

// Autogenerated, do not edit. All changes will be undone.


笑点低系列

// sometimes I believe compiler ignores all my comments


为这位老哥默哀

// I dedicate all this code, all my work, to my wife, Darlene, who will 
// have to support me and our three children and the dog once it gets 
// released into the public.


吐槽

// somedev1 -  6/7/02 Adding temporary tracking of Login screen
// somedev2 -  5/22/07 Temporary my ass


喝醉了也要写注释也是蛮敬业的

// drunk, fix later


犯贱系列

#define TRUE FALSE
//Happy debugging suckers
Catch (Exception e) {
 //who cares?
}
/**
 * Always returns true.
 */
public boolean isAvailable() {
    return false;
}


迷之自信

try {

} finally { // should never happen 

}


跟着唱吧

long long ago; /* in a galaxy far far away */


其它

//This code sucks, you know it and I know it.  
//Move on and call me an idiot later.


作者:ILLYM
链接:https://www.zhihu.com/question/29962541/answer/46519750


點擊查看更多內容
3人點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優質文章

正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優惠券免費領

立即參與 放棄機會
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

舉報

0/150
提交
取消