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?
- Part I: Bee Deaths Mystery Solved? Neonicotinoids (Neonics) May Actually Help Bee Health
- Reasons Serious Scientists Should Not Fear The Winnower and other OA Open Review Journals.
- Education: Stop New Age Thinking, Chalk And Talk Might Be The Best Way After All
- Big Data Could Be A Big Problem For Workplace Discrimination Law
- Interstellar Is A Dangerous Fantasy Of US Colonialism
- The BPA Paradox – Too Many Studies?
- Why Computer Programs Can't Understand Truth - And Ethics Of Artificial Intelligence Babies
- "Thanks for the comment. I tried my best to give an overview of the pluses and minuses of..."
- "I have a suggestion. Perhaps you could charge a small subscription fee for the writing of..."
- "Greetings Science 2.0, just wanted to say that I thoroughly enjoyed this piece. By way of a bit..."
- "Hank, what authoritative publications have specifically addressed Lu's work and evaluated his studies..."
- "I take exception to this vicious attack on a renowned scientist from a renowned institution of..."