令人笑喷的56个代码注释,你写过多少?
点击上方“码农突围”,马上关注
这里是码农充电第一站,回复“666”,获取一份专属大礼包
真爱,请设置“星标”或点个“在看
程序员的幽默(ID:humor1024)整理
老衲不请自来,
给大家献上一波神注释
供施主们娱乐娱乐
/*
* Dear Maintainer
*
* Once you are done trying to ‘optimize’ this routine,
* and you have realized what a terrible mistake that was,
* please increment the following counter as a warning
* to the next guy.
*
* total_hours_wasted_here = 73
*
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
// 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.
// drunk, fix later
// Magic. Do not touch.
// I'm sorry.
return 1; # returns 1
Catch (Exception e) {
//who cares?
}
/**
* Always returns true.
*/
public boolean isAvailable() {
return false;
}
/*
* 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.
*/
try {
} finally { // should never happen
}
const int TEN=10; // As if the value of 10 will fluctuate...
// This code sucks, you know it and I know it.
// Move on and call me an idiot later.
// If this comment is removed the program will blow up
// I am not responsible of this code.
// They made me write it, against my will.
/* Please work */
// no comments for you
// it was hard to write
// so it should be hard to read
options.BatchSize = 300; //Madness? THIS IS SPARTA!
// If this code works, it was written by Paul DiLascia.
// If not, I don't know who wrote it
// Peter wrote this, nobody knows what it does, don't change it!
/** Logger */
private Logger logger = Logger.getLogger();
// I have to find a better job
// Real programmers don’t comment their code.
// If it was hard to write,
// it should be hard to understand.
// This is black magic
// from
// *Some stackoverlow link
// Don’t play with magic, it can BITE.
// For the sins I am about to commit, may James Gosling forgive me
// Comment this later
// Remove this if you wanna be fired
}catch(Exception ex){
// Houston, we have a problem
}
// I can’t divide with zero, so I have to divide with something very similar
result = number / 0.00000000000001.
int getRandomNumber()
{
Return 4; // chosen by fair dice roll.
// guaranteed to be random.
}
#TODO: Figure out what I’m doing here and comment accordingly.
// If this code is still being used when it stops working, then
// you have my permission to shoot me. Oh, you won't be able
// to - I'll be dead...
// If you are reading this, that means you have been put in charge of my previous project.
// I am sorry, so sorry for you. Godspeed.
// I wrote this while drunk, I don’t know what it does,
// but if you remove it the program breaks.
// This code worked before, but my cat decided to take a
// trip across my keyboard...
long long ago; /* in a galaxy far far away */
long john; // silver
#define TRUE FALSE // Happy debugging suckers
// Dear future me. Please forgive me.
// I can't even begin to express how sorry I am.
// private instance variable for storing age
public static int age;
// I am not sure why this works but it fixes the problem.
last = first; /* Biblical reference */
try {
} catch (SQLException ex) {
// Basically, without saying too much, you're screwed. Royally and totally.
} catch(Exception ex)
{
//If you thought you were screwed before, boy have I news for you!!!
}
// John! If you'll svn remove this once more,
// I'll shut you, for God's sake!
// That piece of code is not "something strange"!
// That is THE AUTH VALIDATION.
long time; /* know C */
// Abandon all hope ye who enter beyond this point
/* Ah ah ah! You'll never understand why this one works. */
catch (Ex as Exception) {
// oh crap, we should do something.
}
// TODO make this work
// If you're reading this, then my program is probably a success
// set break point here - you'll never reach it
/*
** The author disclaims copyright to this source code.
** In place of a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
*/
// I'm not sure what I did
// This is crap code but it's 3 a.m. and I need to get this working.
- END - 最近热文
• 数学女博士奥运会摘金!没有教练,用数学知识和计算机软件自己训练,网友:真·学好数理化,走遍天下都不怕 • 我差点信了...... • ERP已死,“中台”已凉,“低代码”称王! • 微信重大更新登热搜 网友:离QQ又近一步
评论