Programmers may not be the guys with the best sense of humor around, but I found it quite entertaining to read a web page with a collection of source code comments arising a smile.
The one I liked the most is the following - not even a comment, but the way the guy called the object he instantiates:
I am sorry if you do not get it - let me try to explain. A program may "throw an exception" if something goes wrong - say it finds itself in the need of dividing by zero, or taking the square root of a negative number, or accessing a non-existing memory address. The language has a command that "throws" the exception, and the exception may have a text attached or other characteristics, which are specified by its constructor command. The code above "throws" the exception called "up", so the code does contain the command "throw up"....
Others might like more the other code segments in the page linked - worth a visit.
- PHYSICAL SCIENCES
- EARTH SCIENCES
- LIFE SCIENCES
- SOCIAL SCIENCES
Subscribe to the newsletter
Stay in touch with the scientific world!
Know Science And Want To Write?
- Suggestion: The EM Drive Is Getting The Appropriate Level Of Attention From The Science Community
- Animal Sex Is Spicier Than We Thought
- Multi-Meter Sea Level Rise This Century? That's Not A Consensus
- Bang! Meet The Highest-Energy Hadron Collision Ever Imaged!
- Bees: Activists Remain Silent While This Pollinator Killer Decimates Millions
- For Now We See Through A Brewing Class, Darkly
- What If We Can 'Pre-Diagnose' Autism In Babies?
- "My response was supposed to be directed to Rich Murray. It seems that you, Josh, thought that it..."
- "OK, thanks. I was wrong and ought to mind my own business. It must have been a strange mood that..."
- "Watching the leopard slug video, I think it's pretty clear they were absolutely loving it...."
- "MORE ABOUT THE TELESCOPES USED TO DISCOVER AND TRACK NEOS - AND THE PEOPLE WHO OPERATE THEMHubble's..."
- "I read about that half a century ago in my Noller’s Organic Chemistry (2nd Edition.) Here’s..."
- Childhood cancer cells drain immune system's batteries
- Genetic tug of war in the brain influences behavior
- New method to predict the amount of nicotine emitted from e-cigarettes
- How bees naturally vaccinate their babies
- Mild hypothermia in deceased organ donors improves organ function in kidney transplant