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?
- Cool, Dim Dwarf Star Is Magnetic Powerhouse
- Our Ethical Responsibilities To Baby Terraformed Worlds - Like Parents
- Supersymmetry Is About To Be Discovered, Kane Says
- Thanksgiving Science 2015
- Discovery Could Open Door To Frozen Preservation Of Tissues, Whole Organs
- Tropical Fossil Forests Unearthed In Arctic Norway
- Secrets Of Dark Proteome
- "And if you watch the video, that turkey is 225 lbs!..."
- "Oh not at all, thanks for asking. Ask away, if you have any other questions, delighted to help..."
- "thank u mr walker its nice to talk to someone with some knowledge hope I'm not getting on your..."
- "Yes it's amazing how bright it gets, especially Venus. It is about at its brightest around now..."
- "no ive got no binoculars wish I had now I was amazed wen I seen it this morning it was just so..."
- Study shows white matter damage caused by 'skunk-like' cannabis
- Cognitive behavior therapy can help overcome fear of the dentist
- Don't forget plankton in climate change models, says study
- Graphene microphone outperforms traditional nickel and offers ultrasonic reach
- New metric mapping top 10 European heat waves predicts strong increase in next 2 decades