代碼注釋是一種用「高級」英語陳述,描述程序將要做什麼的「藝術」。有人嫌它醜,也有人覺得它還蠻有用的。但還有一些「悶騷」的程序猿,早已把代碼注釋玩兒出了花。玩梗、吐槽、畫畫……還有什麼是他們不能做的?
# To understand recursion, see thebottom of this fileAt the bottom of the file# To understand recursion, see thetop of this file//open lid
//take sh!t
//close lidComments for a File open, data dump, file close…/** TODO: Remove this function
function remove($customer_id) { $this->Customer->remove($id); }
*/// IE7 update. this is still badcode, but IE8 is probably a long way off :) toConnect = [] toRead = [ ] toWrite = [ ] primes = [ ] responses = {} remaining = {}// This comment is selfexplanatory.} catch (PartInitException pie) { public boolean isAvailable() { return false;}///////////////////////////////////////this is a well commented lineException up = newException("Something is really wrong.");throw up; // TODO - Comment this function//Mr. Compiler, please do not readthis.Repeat ...Until (JesusChristsReturn) int MyFunction(){ int Result = 0;
MyObject *Ptr = new MyObject();
Result = Ptr->DoSomething();
return Result;}public boolean isDirty() { return dirty;}public GetRandomNumber(){ return 12;}// if i ever see this again i mgoing to start bringing guns to workdef format_ticket_content(text,recursive = true) if text.is_a?(TicketNote) note = text text = note.content else note = nil end
# text = h(text) # # # # # # # # # # # # # # #// Replaces with spaces the bracesin cases where braces in places //cause stasis $str =str_replace(array("{","}")," ",$str); .= .`/,/!(=)Zm. .._,,._.. ,-`- `, ` -` -`\7//WW. ,v=~/.-,---!|V-s.)iT-|s|-. `///mK%. v!`i!-.e]-g`bT/i(/[=.Z/m)K(YNYi.. /-]i44M. v`/,`|v]-DvLcfZ/eV/iDLND/ZK@%8W[Z.. `/d!Z8m //,c(2(X/NYNY8]ZZ/bZd()/WY%WKKW) - |(][%4. ,\ic(e)WX@WKKZKDKWMZ8(b5/ZK8]Z7%ffVM, -.Y!bNMi /-iit5N)KWG%%8%%%%W8%ZWM(8YZvD)XN(@. [ ]!/GXW[ /))G8NMN%W%%%%%%%%%%8KK@WZKYK*ZG5KMi,- vi[NZGM[ i!(44Y8K%8%%%**~YZYZ@%%%%%4KWZ/PKN)ZDZ7 c=//WZK%! ,YtMZW8W%%f`,`.t/bNZZK%%W%%ZXb*K(K5DZ -c\/KM48 -|c5PbM4DDW%f v./c[tMY8W%PMW%D@KW)Gbf -/(=ZZKM8[ 2(N8YXWK85@K - c|K4/KKK%@ V%@@WD8e~ .//ct)8ZK%8` =)b%]Nd)@KM[ ! cG!iWYK%%| !M@KZf -c))ZDKW%` YYKWZGNM4/Pb -VscP4]b@W% Mf` -L///KM(%W! !KKW4ZK/W7)Z. /cttbY)DKW% -` . ,)K(5KW%%f W)KWKZZg)Z2/,!/L(-DYYb54% ,,`, --/v(((KK5WW%f M4NDDKZZ(e!/7vNTtZd)8Mi!-,-/i-v((tKNGN%W%% M8M88(Zd))///((|D DY\KK-`/-i(=)KtNNN@W%%%@%[ !8%@KW5KKN4///s(Pd!ROBY8/=2(/4ZdzKD%K%%%M8@%% %%%W%dGNtPK(c/2[Z(ttNYZ2NZW8W8K%%%%YKM%M%%. *%%W%GW5@/%!e]_tZdY()v)ZXMZW%W%%%*5Y]K%ZK%8[ *%%%%8%8WK)[/ZmZ/Zi]!/M%%%%@f Y/NNMK%%! VM%%%%W%WN5Z/Gt5/b)((cV@f` -|cZbMKW%%| V*M%%%WZ/ZG 5((+)L -,,/ -)X(NWW%% `~`MZ/DZGNZG5(((, ,t\Z)KW%@ M8K%8GN85(5///]i!vK)85W%%f YWWKKKKWZ8G54X/GGMeK@WM8%@ !M8%8%48WG@KWYbW%WWW%%%@ VM%WKWK%8K%%8WWWW%%%@` ~*%%%%%%W%%%%%%%@~ ~*MM%%%%%%@f` /************************************************************ * * * .=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-. * * | ______ | * * | .-" "-. | * * | / | * * | _ | | _ | * * | ( |, .-. .-. ,| / ) | * * | > "=._ | )(__/ __)( | _.=" < | * * | (_/"=._"=._ |/ / | _.="_.="_) | * * | "=._"(_ ^^ _)"_.=" | * * | "=__|IIIIII|__/=" | * * | _.="| IIIIII/|"=._ | * * | _ _.="_.=" /"=._"=._ _ | * * | ( _.="_.=" `---` "=._"=._/ ) | * * | > _.=" "=._ < | * * | (_/ _) | * * | | * * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= * * * * LASCIATE OGNI SPERANZA, VOICH ENTRATE * LEAVE EVERY HOPE, YOU COME IN *************************************************************/https://medium.com/javascript-in-plain-english/30-funny-code-comments-that-will-make-you-laugh-1c1b54d4ab00