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?
- Radical Rethink: Sugars Are The Only Cause Of Tooth Decay
- Life After The 125 GeV Higgs: What Is Left Of Two-Higgs Doublet Models
- Being Too Analytical Could Push Ethics Out The Door
- It's Almost 2015 - So Where Is My Hoverboard?
- Rapidly Evolving Lizards Show How Some Creatures Can Adapt To Beat Climate Change
- Drugs For Mild Hypertension In Low Risk People Questioned
- Keytruda: FDA Approves Melanoma Drug That Uses Immune System To Fight Cancer
- "Hi Luis,thanks for the quote. Of course we are looking in every corner of phase space... Cheers,T...."
- "Hello Tony,of course ATLAS and CMS are looking for new Higgs states in that mass region and..."
- "Dear Inventor,it is not a generalization, it is the necessary result of the introduction of the..."
- "I doubt she read it far enough to see the details of the proposal. You are welcome to recommend..."
- "I do hope Hontas actually read your proposal (bet) before deleting it, since I truly hope she takes..."
- Imaging identifies asymptomatic people at risk for stroke
- Researchers debunk myth about Parkinson's disease
- Dental and nutrition experts call for radical rethink on free sugars intake
- Study shows consumption of high-fat dairy products is associated with a lower risk of developing diabetes
- Study adds to cancer-fighting promise of combined immunotherapy-radiation treatment