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?
- Giddings: The 750 GeV Diphoton Resonance Is A Graviton
- The Greenhouse Effect Fallacy
- Social Media Is Looking Old, Tired And Grumpy
- Inconvenient Truth: There Are Synthetic Pesticide Residues On Organic
- From The Great Wall To The Great Collider
- No Higgs Needed: 5 Ways Particle Accelerators Have Changed The World
- Starting Age Of Marijuana Use May Have Long-term Effects On Brain Development
- "The USA is not a democracy it is a federal republic based on a combination of Native American and..."
- "There are recent longitudinal studies, with well over 100 sets of twins included. The studies disclosed..."
- "Hi Tommaso,There are by now many possibilities to explain possible new particles, and one must..."
- "It may... Or it may not! THAT'S SCIENCE!!! ..."
- "(sarc on) Nice try! (sarc off) Typical reply from an uninformed ditto-head alarmist, that is, to..."
- National Academy of Medicine Supports Replacing Faulty Mitochondrial DNA
- Pregnant & Still Smoking: Better Way Needed To Quit
- ‘Healthy Obesity’ May Be an Oxymoron, Study Says
- Keeping the PBJ, While Chasing NBA Immortality
- The Public Toilet Seat’s Place on the ‘Ick Scale’
- Moms-to-Be: Take Chocolate Benefits With Grain of Salt