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?
- 3 Papers Discuss The Molecular Toolkits We Share With Flies And Worms
- Proton-Proton Fusion: Looking Into The Heart Of The Sun
- Junk Food Rats Ditch Balanced Diet To Eat Just Like Obese People
- Global 'Roadmap' Shows Where To Put Roads Without Costing The Earth
- Schrödinger's Picture: Researchers Take An Image Without Ever Detecting Light
- Is That A Real Patient Or A Junkie? Now There's An App For That
- E-Cigarettes Versus Cigarettes: 10X Decrease In Second-Hand Smoke
- "How does co-evolution equivalent to the naturalistic fallacy? It seems that you are quite prone..."
- "You misunderstand me again, (maybe willingly) and exaggerate again: 1. Misunderstanding: (what..."
- "Then why not endorse homeopathy and raw milk?That's a non sequitur. I am merely pointing..."
- "It is quite an advance that researchers now look harder for meaning in DNA segments of unknown..."
- "The Chinese herbal practitioner prescribed Chuan Wu, Cao Wu AND Fu Zi in one prescription? To improve..."