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?
- Random Thoughts Of A Physicist In Honeymoon
- Anomaly! Book Of The Week At Times Higher Education
- Eugene Cernan, Hometown Astronaut of Bellwood Illinois dead at 82.
- Climate Change Made The Sahara Green - Then Took It Away Again
- It's Been Another Record Year For Agriculture - When Do Climate Change Forecasts Come True?
- How Wind Turbines Work - A Legal Perspective
- Anomaly! At 35% Discount For Ten More Days
- "I don't know why my comment's formatting was lost in the transmission, so that it is now one big..."
- "“If you don't use probabilities then how else do you do it? At any rate that's not a criticism..."
- "Tomasso, Congratulations, may you enjoy a long and happy life together with Kalliopi! Best regards..."
- "Found another one : http://www.dailystar.co.uk/news/latest-news/545975/end-of-the-world-Gods-vengeance..."
- "Thanks :). Actually there are so many fake doomsday red top tabloid stories that I tend to wait..."
- A Drug 85 Times More Potent than THC Caused 'Zombie Outbreak' in New York City
- Doubt Cast Over Sunscreen-Vs.-Shade Study
- ABCD: Obesity Has A New Name, Will It Stop The Epidemic?
- President George H. W. Bush in ICU, Wife Barbara in Same Hospital
- Media Think World of Science and Health Will End on Inauguration Day 2017
- And Then There Were Three: A New Trivalent Herpes Vaccine Enters The Scene