当前位置:网站首页>Those programmers wrote super funny 56 code comments (worth collecting)!!

Those programmers wrote super funny 56 code comments (worth collecting)!!

2022-06-23 21:20:00 yz_ weixiao

/*

  • 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 modify this program ' Optimize '

And you've realized what a terrible mistake this is ,

Please increase the number of counters below to warn the latecomers

The total time wasted here = 73

1.

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

exception = New exception (" There is a problem .")

give up ; // ha-ha

2.

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

When I write this , Only God and I understand what I'm doing

Now? , Only God knows

3.

// sometimes I believe compiler ignores all my comments

Sometimes , I will believe that the compiler will ignore all my comments

4.

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

With this code , To my wife Darlene , Thank her for supporting me , And my three children and a dog .

5.

// drunk, fix later

Drink too much , Repair it another day

6.

// Magic. Do not touch.

magic ! Don't touch .

7.

// I'm sorry.

I'm sorry .

8.

return 1; # returns 1

return 1;# return 1

9.

Catch (Exception e) { //who cares? }

Capture ( abnormal e)

Who cares? ?

10.

/**

  • Always returns true. */ public boolean isAvailable() { return false; }

The code returns false , Comments always return true

11.

/*

  • 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 that you can read the following code ,

But it's absolutely impossible , believe me .

Once you've debugged , You'll definitely regret trying to optimize the code by pretending to be smart .

The best way is to close the file ,

Go play with something you like !

12.

try { } finally { // should never happen }

It will never run here

13.

const int TEN=10; // As if the value of 10 will fluctuate...

As if 10 The value of will fluctuate ...

14.

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

This code is really bad , I know and you know ,

Don't scold me first , Please look down first

15.

// If this comment is removed the program will blow up

If you delete the note here , The program blew up

16.

// I am not responsible of this code. // They made me write it, against my will.

I'm not responsible for this code

They forced me to write , Against my will .

17.

/ Please work /

Please work

18.

// no comments for you // it was hard to write // so it should be hard to read

No comment ,

It's hard to write. ,

So it should be hard to read

19.

options.BatchSize = 300; //Madness? THIS IS SPARTA!

Are you crazy ? This is Sparta !

20.

// If this code works, it was written by Paul DiLascia. // If not, I don't know who wrote it

If this code works properly , So Paul DiLascia Written

otherwise , I don't know who wrote it

21.

// Peter wrote this, nobody knows what it does, don't change it!

It was written by Peter , No one knows what it does , Don't change !

22.

/* Logger / private Logger logger = Logger.getLogger();

No matter how hard you try , People get hurt when they get hurt .by Haruki Murakami

23.

// I have to find a better job

I must find a better job

24.

// Real programmers don’t comment their code. // If it was hard to write, // it should be hard to understand.

Real Programmers don't annotate their code .

If it's hard to write

It should be hard to understand

25.

// This is black magic // from // *Some stackoverlow link // Don’t play with magic, it can BITE.

This is from stackoverlow Black magic of

Don't play magic , It will bite

26.

// For the sins I am about to commit, may James Gosling forgive me

For the crime I'm about to commit , I hope James · Gauss Lin (James Gosling) Can you forgive me

27.

// Comment this later

Comment on this later

28.

// Remove this if you wanna be fired

If you want to get fired , Just delete it

29.

}catch(Exception ex){ // Houston, we have a problem }

Houston, We have a question

30.

// 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 going to divide by a very similar number

31.

int getRandomNumber() { Return 4; // chosen by fair dice roll. // guaranteed to be random. }

Choose by rolling the dice fairly

Guaranteed to be random

32.

TODO: Figure out what I’m doing here and comment accordingly.

Figure out what to do here and comment accordingly

33.

// 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 is still in use when it stops working ,

Kill me , Oh ~ You can't do that

I'm dead ......

34.

// 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 , This means that you have been appointed as the head of my previous project .

I'm sorry , I'm sorry . Good luck .

35.

// I wrote this while drunk, I don’t know what it does, // but if you remove it the program breaks.

I wrote it when I was drunk , So I don't know what it's for

But if you delete it , The program will break

36.

// This code worked before, but my cat decided to take a // trip across my keyboard...

This code used to be valid , But my cat decided to run on my keyboard

37.

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

Far, far beyond the Milky way ( This code can run , It's definitely a miracle )

38.

long john; // silver

Treasure Island

39.

define TRUE FALSE // Happy debugging suckers

Be happy to debug your code , ha-ha

40.

// 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 tell how sorry I am

41.

// private instance variable for storing age public static int age;

Private instance variable used to store age

42.

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

Although I don't know why it works , But it fixed the problem

43.

last = first; / Biblical reference /

The last is the beginning , The Bible quotes

44.

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!!! }

Needless to say , Basically, you're finished

45.

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

For God's sake , I want to close you

This code is not “ Strange things ”

That's authentication

46.

long time; / know C /

It took me a long time to know

47.

// Abandon all hope ye who enter beyond this point

Those who enter this door end their hope

48.

/ Ah ah ah! You'll never understand why this one works. /

Ah ah ! You will never understand why this method works

49.

catch (Ex as Exception) { // oh crap, we should do something. }

too bad , We should do something

50.

// TODO make this work

use TODO Do it

51.

// If you're reading this, then my program is probably a success

If you're reading this code carefully now , Then there should be no problem writing this code

52.

// set break point here - you'll never reach it

Set the breakpoint here - You'll never be perfect

53.

/* ** 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 the copyright of this source code

This is a blessing , Instead of legal notice

May you do good and not evil .

May you forgive yourself , Forgive others

May you share freely , Never go beyond giving

54.

// I'm not sure what I did

I'm not sure what I did

55.

// This is crap code but it's 3 a.m. and I need to get this working.

This is junk code , But it's early morning 3 spot , I need to get him running

Python Advanced notes 、 The latest interview review notes PDF, my GitHub

At the end of the article What's your opinion on the article , Or any technical problems , Welcome to leave a message and discuss in the comment area !

原网站

版权声明
本文为[yz_ weixiao]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/12/202112251144313546.html