
Programmer's humor (ID: humor1024) finishing
I came here uninvited,
Give everyone a wave of God's commentary
For the entertainment of donors

0.
copy/* * 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 *
dear maintainer
If you try to 'optimize' this program
and you've realized what a terrible mistake this is,
Please increase the number of the following counters to warn others
Total time wasted here = 73
1.
copyException up = new Exception("Something is really wrong."); throw up; //ha ha
Exception = new Exception("There is indeed a problem.")
give up; // lol
2.
copy// When I wrote this, only God and I understood what I was doing // Now, God only knows
As I write this only God and I know what I'm doing
now only god knows
3.
copy// sometimes I believe compiler ignores all my comments
Sometimes, I would trust the compiler to ignore all my annotations
4.
copy// 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.
I dedicate this code to my wife, Darlene, for always supporting me, my three children, and my dog.
5.
copy// drunk, fix later
Drink too much, fix it another day
6.
copy// Magic. Do not touch.
magic! do not touch.
7.
copy// I'm sorry.
Feel sorry.
8.
copyreturn 1; # returns 1
return 1; # return 1
9.
copyCatch (Exception e) { //who cares? }
catch(exception e)
who cares?
10.
copy/** * Always returns true. */ public boolean isAvailable() { return false; }
Code returns false , annotations always return true
11.
copy/* * 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. */
You may believe you can read the following code,
But it's absolutely impossible, trust me.
Once you've debugged it, you'll absolutely regret trying to be smart about optimizing this code.
The best way is to close the file,
Go play something you like!
12.
copytry { } finally { // should never happen }
definitely won't run here
13.
copyconst int TEN=10; // As if the value of 10 will fluctuate...
It seems like the value of 10 fluctuates...
14.
copy// This code sucks, you know it and I know it. // Move on and call me an idiot later.
This code really sucks, and I know you know it too,
Don't scold me yet, please read on
15.
copy// If this comment is removed the program will blow up
If you delete the comment here, the program will explode
16.
copy// I am not responsible of this code. // They made me write it, against my will.
I am not responsible for this code
They forced me to write, against my will.
17.
copy/* Please work */
please work
18.
copy// no comments for you // it was hard to write // so it should be hard to read
no comment,
hard to write,
So it should be hard to read
19.
copyoptions.BatchSize = 300; //Madness? THIS IS SPARTA!
Are you crazy? This is Sparta!
20.
copy// If this code works, it was written by Paul DiLascia. // If not, I don't know who wrote it
If this code works, Paul DiLascia wrote it
Otherwise, I don't know who wrote it
21.
copy// Peter wrote this, nobody knows what it does, don't change it!
This is what Peter wrote, no one knows what it does, don't change it!
22.
copy/** Logger */ private Logger logger = Logger.getLogger();
No matter how hard you try, people get hurt when they get hurt. by Haruki Murakami
23.
copy// I have to find a better job
i have to find a better job
24.
copy// Real programmers don't comment their code. // If it was hard to write, // it should be hard to understand.
Real programmers don't comment their code.
if it is difficult to write
should be incomprehensible
25.
copy// This is black magic // from // *Some stackoverlow link // Don't play with magic, it can BITE.
This is black magic from stackoverlow
Don't play magic, it will bite
26.
copy// For the sins I am about to commit, may James Gosling forgive me
I hope James Gosling will forgive me for the crime I am about to commit
27.
copy// Comment this later
comment on this later
28.
copy// Remove this if you wanna be fired
delete it if you want to get fired
29.
copy}catch(Exception ex){ // Houston, we have a problem }
Houston, we have a question
30.
copy// I can't divide with zero, so I have to divide with something very similar result = number / 0.00000000000001.
I can't divide by 0, so I'm dividing by a very similar number
31.
copyint getRandomNumber() { Return 4; // chosen by fair dice roll. // guaranteed to be random. }
Choose by fair roll of the dice
guaranteed to be random
32.
copy#TODO: Figure out what I'm doing here and comment accordingly.
Figure out what to do here and add comments accordingly
33.
copy// 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 this code was still in use when it stopped working,
kill me, oh~ you can't do that
I am dead......
34.
copy// 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.
If you see this, it means you have been appointed as the lead of my previous project.
I'm sorry, I'm so sorry. Good luck.
35.
copy// I wrote this while drunk, I don't know what it does, // but if you remove it the program breaks.
I wrote this while I was drunk, so no idea what it's for
But if you remove it, the program breaks
36.
copy// This code worked before, but my cat decided to take a // trip across my keyboard...
This code used to work, but my cat decided to make a trip to my keyboard
37.
copylong long ago; /* in a galaxy far far away */
Far, far out in the galaxy (it's an absolute miracle that this code works)
38.
copylong john; // silver
treasure island
39.
copy#define TRUE FALSE // Happy debugging suckers
Happy to debug your code, haha
40.
copy// Dear future me. Please forgive me. // I can't even begin to express how sorry I am.
Future dear me, please forgive me
i can't express how sorry i am
41.
copy// private instance variable for storing age public static int age;
Private instance variable to store age
42.
copy// I am not sure why this works but it fixes the problem.
I don't know why this worked, but it fixed the problem
43.
copylast = first; /* Biblical reference */
The end is the beginning, bible quote
44.
copytry { } 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!!! }
Needless to say, basically you're screwed
45.
copy// 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.
if you delete again
For god's sake I'm gonna shut you down
This code is not some "strange thing"
that is authentication
46.
copylong time; /* know C */
It took a long time to know
47.
copy// Abandon all hope ye who enter beyond this point
Those who enter this gate end hope
48.
copy/* Ah ah ah! You'll never understand why this one works. */
Ahhh! You'll never understand why this method works
49.
copycatch (Ex as Exception) { // oh crap, we should do something. }
shit we should do something
50.
copy// TODO make this work
do this with TODO
51.
copy// If you're reading this, then my program is probably a success
If you are reading this code carefully and in detail now, there should be no problem with writing this code
52.
copy// set break point here - you'll never reach it
Set breakpoints here - you'll never be perfect
53.
copy/* ** 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. */
The author waives copyright in this source code
This is a blessing, not a legal notice
May you do good and not evil.
May you forgive yourself and forgive others
May you share freely and never give more than you give
54.
copy// I'm not sure what I did
i'm not sure what i did
55.
copy// This is crap code but it's 3 a.m. and I need to get this working.
This is crap but it's 3am and I need it to work
Past recommendation
Still using Random to generate random numbers? Try ThreadLocalRandom, super easy to use!
Message idempotence (deduplication) general solution, really top!
Spring Boot 2.x Basic Tutorial: Fragmentation Configuration Using Elastic Job
The strongest code generator platform, killing crazy!
If you like this article, please forward it, follow me and subscribe for more exciting
Follow me and reply to "Add group" to join the Spring technology exchange group