Here are some of the funniest comments found in code.
If you have learned programming in past, you should be familiar with comments. These comments are programmer readable text that is simply ignored by the compiler when they are executed.
Comments are for programmer’s convenience, they usually use them to store some important information, directions,and To-Dos . Sometimes, programmer’s also include information that may come in handy when someone other is given charge of maintaining or editing the code.
However, in some cases, many programmers use them to show their humor or even sometimes share their feelings.
To collect some of the funniest comments found in code, I started digging in Stack Overflow and in Quora. I found more that a dozen comments that I can’t help sharing with you.
So, Here are some of the funniest comments found in code:
The God only code
//When I wrote this, only God and I understood what I was doing
//Now, God only knows
What’s in The Name
#shakespeare was wrong, name is necessary
# names the output buffer/file
virgin = 0; /* you're not a virgin anymore, sweety */
IE Deserves a special treatment
after hours of consulting the tome of google
i have discovered that by the will of unknown forces
without the below line, IE7 believes that 6px = 12px
You Need To Pay him Well
// I'm not paid for this...
Sorry that you will have to deal with this
// If you're reading this, that means you have been put in charge of my previous project.
// I am so, so sorry for you. God speed.
The Proper license
/* The License:
You (from this point on referred to as The You) are hereby
granted by me (from this point on referred to as The Me)
license to knock yourself silly with this template.
By using this template The You implicitly accepts this
license and pledges solemnly to never claim creative
ownership of any graphics, code, concepts, eggs, bacon, ideas,
colors, shapes, hypertext-transfer protocols or other conduits
of the visual splendor thatis this template.
The Me, in turn, pledges equally solemnly to be far too
lazy to ever check up on you, so if you do manage to pull
some chicks The Me won't have a cow.
However The Me would be sorely disappointed if The You
were to try and sell or distribute this work without
acknowledging The Me. Seriously. The Me will come down on
The You like a large quantitiy of hard and heavy objects
that in large quantities may be harmful and possibly even
lethal to The You; So don't even think about it, The Buster.
Realtek is bad?
This funny comment was written by a guy who coded a driver for a Realtek card.
* The RealTek 8139 PCI NIC redefines the meaning of 'low end.' This is
* probably the worst PCI ethernet controller ever made, with the possible
* exception of the FEAST chip made by SMC. The 8139 supports bus-master
* DMA, but it has a terrible interface that nullifies any performance
* gains that bus-master DMA usually offers.
// no comments for you
// it was hard to write
// so it should be hard to read
The chicken story
/* Emits a 7-Hz tone for 10 seconds.
True story: 7 Hz is the resonant frequency of a
chicken's skull cavity. This was determined
empirically in Australia, where a new factory
generating 7-Hz tones was located too close to a
chicken ranch: When the factory started up, all the
Your PC may not be able to emit a 7-Hz tone. */
#Today,I take this opportunity to tell you about this super cool function
#and the core logic
#It's already 4 am and I have been coding this function since, well forever
#So I have no idea what I have done, or even why am I typing this
#but it works.period. If you want to know how, find it yourself
// There once was a man named Dave
int Result = 0;
// Whose code just wouldn't behave
MyObject *Ptr = new MyObject();
// He left to go to a meetin'
Result = Ptr->DoSomething();
// And left his memory a leakin'
This isn't the right way to deal with this, but today is my last day, Ron
just spilled coffee on my desk, and I'm hungry, so this will have to do...
return 12; // 12 is my lucky number
/* * Your warranty is now void. * * We are not responsible for bricked
devices, dead SD cards, * thermonuclear war, or you getting fired because
the alarm app failed. Please * do some research if you have any concerns
about features included in this ROM * before flashing it! YOU are choosing
to make these modifications, and if * you point the finger at us for messing
up your device, we will laugh at you.
Calling all the Gods
/*Lord of code, thee who art most understandable, extensible and manageable. Forgive me as I undertake this blasphemous quest to write a solution with previously badly written code, and break my vows of old, in committing myself to extending the prior mentioned code with my own dirty code. Grant that this quest be successful and may I never have to commit such acts ever again. */
Talk Like Man
$you = live("free") or die("hard");
I Hope these funniest comments found in code made you laugh a bit. Do you recall any other funny comment in programs? share with others in the comments below.