search
尋找貓咪~QQ 地點 桃園市桃園區 Taoyuan , Taoyuan

老外的那些讓人淚奔的代碼註釋

當你在寫新功能時,你是不是總想在關鍵地方加幾句註釋,以便後續修改?

但是! 事實真的如你所願么? 看看下面這些註釋,我想你能找到自己的影子。

// Magic. Do not touch.

神奇的代碼,請勿改動

// drunk, fix later

喝醉啦,遲些再弄

/*

* You may think you know what the following code does.

* But you dont Trust me.

* Fiddle with it, and you』ll 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

*/

你以為你了解下面這些代碼,但是你不相信我,你將會在無盡的通宵中不斷地咒罵自己為什麼會認為自己聰明,聰明到可以優化這段代碼。好了,現在請關閉這個文件去玩點別的吧。

double penetration; // ouch

狂插兩下; //痛啊

// I am not sure why this works but it fixes the problem.

反正這個辦法就修復了問題,我也不知道為什麼會這樣

// Dear future me. Please forgive me.

// I can』t even begin to express how sorry I am.

親愛的未來的我自己,請原諒我。我有著難以表達的歉意。

// no comments for you

// it was hard to write

// so it should be hard to read

沒有註釋留給你,難寫的代碼必定難讀

options.BatchSize = 300; //Madness? This is SPARTA!

瘋了嗎?歡迎來到斯巴達。

// I am not responsible of this code.// They made me write it.

我不對以下代碼負責。是他們逼我寫的。

你寫過哪些奇葩的註釋呢? 在評論區分享一下吧!



熱門推薦

本文由 yidianzixun 提供 原文連結

寵物協尋 相信 終究能找到回家的路
寫了7763篇文章,獲得2次喜歡
留言回覆
回覆
精彩推薦