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?
- Nobel Prize To Neutrino Oscillations
- Nobel Prize Validates Chinese Medicine? Nope.
- In Plain English: Why Neutrino Mass and Oscillation Won A Nobel Prize.
- Celiac Disease Diagnosis Gets Simplified
- Prenatal BPA Exposures (Don’t) Affect Birth Weight
- What Is Fat For?
- Machine learning vs NRA, a Grand Challenge
- "Very similar to the Laetrile story, which is the subject of the first chapter of Paul Offit's Do..."
- "Something to scream at:BREAKING NEWS: Boy, 10, suffering with jaw cancer who needs 'urgent surgery'..."
- "I remember Yoji Totsuka from Moriond Workshops, together with Koshiba. This was also a great loss..."
- "Thanks for writing. Happy to help. I could work 24/7 and not keep up with bad science and medicine..."
- "Thanks for this clarifying note for the non expert! As a physicist, I'm appalled by how my local..."
- Solid Reporting on the (Non) Risks of Roundup
- Calcium Heart Score May Predict Low Risk of Coronary Events
- Asthma Meds Safe for Babies, Despite Study Findings
- Effectiveness of Beta-blockers Questioned by New Study
- Defending Deserved Nobel Winners from Baseless Attacks
- Notable Progress Made on Male Birth Control Pill