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?
- Brain Cancer: Why Glioblastoma Is So Difficult To Treat
- Bewildering Dune Formation On Mars
- How A Former Naturopath Can Help Unravel The Trickery of Alternative Medicine
- Some Celiac Disease May Be Due To Viruses
- Thinking 'I Can Do Better' Really Can Improve Performance, Study Finds
- Out Of Africa: What They Do Not Tell Us
- Little To No Association Between Butter Consumption And Chronic Disease Or Total Mortality
- "The etymology of the word medicine starts long before western/scientific medicine. Some definitions..."
- "A side note to your side note: agreed, 'side effects' are just effects of a drug. But who wants..."
- "Britt, I admire your ethics in standing up for what you believe is right, and for sacrificing your..."
- "Agreed, many people tend to jump the gun when they see an article like his and don’t read down..."
- "One other thing. It's kind of absurd to argue that if you don't have a solution you can't discuss..."