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?
- Ignorance Of Math And Physics Is No Excuse
- Quantum Cryptography Core Question At The Heart Of Quantum Information Theory Answered?!?
- Mars Lost An Ocean’s Worth Of Water
- Science Debunks Fad Ideas About Autism, But That Doesn't Dissuade Believers
- War On Doping And The Hypocritical Treatment Of Lance Armstrong
- The Law has Failed, Not Forensic Science
- Unregulated Genetic Testing Websites Still Causing Concerns
- "Islands in the stream, that is what math and physics are. Seemingly nothing in between, but this..."
- "Your analysis is idiotic. Why? Two reasons. First, these studies compare aggregate scores. That..."
- "You give evidence of the general incompetence found in science when those who can memorize are..."
- "I find common ground in the fact that i was scared of mathematics when it came to practicing for..."
- "This is only partly true. The arachidonic acid prostaglandin pathway is involved in pain..."
- Infant growth affected by exposure to environmental pollutants
- Fast food commercials to kids 'deceptive' by industry self-regulation standards
- Another study links heart disease to sitting
- Unregulated web marketing of genetic tests for personalized cancer care raises concerns
- Cultural hypocrisy and Jane Austen's death by popularity