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?
- Family Holiday Survival: 12 Ways To Deal With That Climate Change Denier
- A Vegetarian Carnivorous Plant...Wait, What?
- To Survive A Heart Attack, It Helps To Be Fat
- Falsifiability And The Integrity Of Physics
- Wave-Particle Duality And Quantum Uncertainty - Two Sides Of The Same Mystery?
- Dr. Ozvorkian And The Amoebas
- Guest Post: Ben Allanach, On Open Access
- "This bit of silliness is going to need documentation...."
- "People in general, and especially layman when considering a technical subject, think in terms of..."
- " Meanwhile, we need to address serious problems in science-based medicine.The only thing worse..."
- "I have hemochromatosis which has caused me to develop arthropathy or sore joints which don't seem..."
- "Part of the issue is that theoretical physics can deal with issues which we do not have the technology..."
- High doses of vancomycin fuel risk of kidney damage in children - small study
- Ebola vaccine candidate safe and equally immunogenic in Africa
- What happens to patients when cardiologists are away at national meetings?
- Physical violence and fluctuations of cortisol levels in women linked
- Riluzole may prevent foggy 'old age' brain