प्रकटीकरण: जब आप हमारे लिंक के माध्यम से सेवा या उत्पाद खरीदते हैं, तो हम कभी-कभी कमीशन कमाते हैं।

28 मजेदार कोड टिप्पणियाँ हर डेवलपर को पढ़ना चाहिए

वे कहते हैं:

“यदि आपको अपने कोड को समझाने के लिए टिप्पणियों की आवश्यकता है, तो कोड अपना इरादा बहुत अच्छा नहीं दिखा रहा है।

परन्तु फिर,

यदि कोड, अच्छा या अन्यथा, टिप्पणियों की आवश्यकता नहीं है, तो टिप्पणियों को जोड़ने के लिए वाक्यविन्यास मौजूद नहीं होगा। इसके बारे में सोचो।"

हमने इंटरनेट पर सर्फिंग की है और डेवलपर्स द्वारा अपने कोड में लिखी गई कुछ सर्वश्रेष्ठ कोड टिप्पणियों को हाथ से चुना है।

उन्हें पढ़ें और मज़े करें…

1.
# To understand recursion, see the bottom of this file
.
. (at the end of the code...)
.
# To understand recursion, see the top of this file

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

3.
/* You are not meant to understand this */

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.

क्रिस वैगनर

क्रिस वैगनर कहते हैं:
“एक प्रोग्रामर के रूप में, मैं अक्सर उन कोड से जूझता रहता हूं जो मेरे स्थानीय मशीन पर काम करने लगते हैं लेकिन वेबसर्वर पर नहीं।

मुद्दे सर्वर से संबंधित हो सकते हैं - यह एक गलत कॉन्फ़िगरेशन या बस सर्वर नीचे जा रहा हो सकता है।

यदि आप उत्कृष्ट समर्थन और शानदार अपटाइम, चेकआउट के साथ विश्वसनीय सर्वर देख रहे हैं GreenGreeks।

They are Geeks just like us & really green on the environment.”

5.
# This is becoz you messed with me the other day
if current_admin.name == "#{my_x_employer}"
sleep(1000 * 3600)
end

6.
// Drunk, fix later.

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

8.
// Magic. Do not touch.

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

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

ठीक है, अगर आप अपने प्रोजेक्ट और कोड को गड़बड़ाना नहीं चाहते हैं, तो आपको प्रोजेक्ट मैनेजमेंट और कोड मैनेजमेंट करना चाहिए।

बकाया निश्चित रूप से इसमें आपकी मदद कर सकते हैं।

11.
// I have to find a better job

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

13.
last = first /* Biblical reference */

14.
// I can't divide it with zero, so I have to divide it with something very similar result = number/0.00000000000001

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

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

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

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

19.
long time; /* know C */

20.
// Once upon a time, two `array_map` calls were sitting there,
// but for some reasons, they triggered `E_WARNING`
// time to time (because of PHP bug [55416]
// (https://bugs.php.net/bug.php?id=55416).
// Now, they are gone.

21.
//
//3.4 JeK My manager promised me a lap dance if I can fix this release
//3.5 JeK Still waiting for that dance from my manager
//3.6 JeK My manager got changed, the new manager is hairy, don’t want the dance anymore
//3.7 Jek Got that dance, yuck!
//

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

23.
//Mr. Compiler, please do not read this.

24.
//open lid
//
//take shit
//
//close lid

25.
//This was clearly written under duress.

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

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

28.
// IDIOTS DON’T TOUCH WHAT YOU DON’T UNDERSTAND!!!!

इसलिए साबित किया गया, यहां तक ​​कि PROGRAMMERS कई बार विनोदी भी हो सकते हैं मजाक बनाया जा सकता है कोडिंग पर भी।

आखिरकार, यह नीरस है और पूरे दिन कोड पर काम करने के लिए, आपको इसकी आवश्यकता है प्रेरित रहो। ऐसा करते समय मज़ा क्यों नहीं आता और कोडिंग का आनंद क्या होता है?

ये उनमें से कुछ ही थे। यदि आपके पास कोई अन्य मजाकिया टिप्पणी है (या इसे कहीं पढ़ा है) जो कि एक कोडर उपयोग कर सकता है, तो बेझिझक एक उत्तर छोड़ें और इसे हमारे साथ साझा करें।

चलो मिलकर मजे करते हैं!