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?
- Why An Extra Planet Can't Be Hidden Behind The Sun Or Above The South Pole
- My Applied National Security Paper. Being President Isn't For Idiots.
- Why Has Organic Farming Flatlined?
- Hugh Hefner's Wife Was Not Poisoned By Breast Implants
- Top Scientists Chastise Greenpeace
- SYRINA: A Trojan Horse For Endocrine Disrupting Chemicals?
- The Daily Physics Problem - 5
- "I try this one... I am a bit rusty, so my solution can be dramatically wrong. Given that B is uniform..."
- "wow! with a name like Wilhelmina Pelegrina, she can't do no wrong. also,some of the problems in..."
- "This is the best you could do? Golden Rice is in the public domain - the lack of any corporate..."
- "Dylan, okay first TL:DR, the answer is that for anything of 10 km upwards, months or a year or..."
- "Some more citations to work into the text later on:Eric Christensen, director of the UA's Catalina..."
- Cancer As Modern Lifestyle Disease? Only If There Was Processed Food 2 Million Years Ago
- Blood Test for Alzheimer’s: Close Or Hype?
- The Flavor Enhancing Molecule in Roasted Garlic Powder
- Pediatricians Should Provide Sex Ed, But Many Don’t
- Calico Cats Are A Walking Genetics Lesson
- Statins Could Help Prevent Some Pregnancy Ills
- An extraordinary standard: New NIST protein could spur biopharmaceutical innovation
- Early detection of leukemia patients' resistance to therapy
- Research reveals restorative justice reduces recidivism
- Recovery of dopamine function emerges with recovery from smoking
- Scientists call for increased federal investment in sustainable agriculture