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?
- Erupting Bardarbunga Volcano In Iceland Sits On A Massive Magma Hot Spot
- Genetically Modified Stem Cells Kill Brain Tumors
- Researchers Created A Laser Bullet To See What It Would Look Like - And Here It Is
- How Gut Bacteria Ensure A Healthy Brain – and Could Play A Role In Treating Depression
- Psychiatry Should Switch From Symptom-based Prescriptions To Target-based
- Climate Change Caused By The Ocean
- Cold Fusion: A Better Study On The Infamous E-Cat
- "But do you understand that these futuristic machines may also be used to study the property of..."
- "Both in this article and the press release from ASU Biodesign are carefully worded allusion to..."
- "These are idiotic concerns. Non-steroidal anti-inflammatory drugs aren't always used to treat inflammation..."
- "So 'volcano boarding' is apparently a thing for the well-to-do hipster extreme sports community..."
- "If we had a contest between the USA and UK, perhaps weighted according to population or GDP, which..."
- How to sell a toxic pesticide the smart way–call it organic
- Leftist dystopia? Anti-technology fever animates opposition to GMOs and other ‘disruptive’ technologies
- CDC faced a nearly impossible balancing act with Ebola, and failed
- Why Chobani reversed course, making yoghurt only from milk from cows not fed GMO grain
- Monterey, California, hotbed of anti-GMO activism, home to new GMO corn farm
- Evolution is sometimes messy or even outright ridiculous