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?
- Wait, Let's Not Rush To Be Multiplanetary Or Interstellar - A Comment On Elon Musk's Vision
- Ground Squirrels Use The Sun To Hide Food
- Study Explains Mechanisms Behind Glioblastoma Influence On The Immune System
- A Book By Guido Tonelli
- Paleo: In A Clinical Trial, Bread Made With Ancient Grains Could Benefit Heart Health
- Brown Adipose Tissue Can Secrete Factors That Activate Fat And Carbohydrate Metabolism
- Chatelperronian Hominins: Disputed Neanderthal Region Confirmed In France
- "Right, good thoughts :). On replicators, yes if a species can make robust self replicating spaceships..."
- "Nope, only Italian for now.Cheers,T...."
- "Is the book available also in English?..."
- "Oh, had to look it up, that's the first asteroid to be detected with a tiny 1 in a million chance..."
- "Robert hey you know the asteroid called 2002 NT7? I know that NASA already ruled out the possibility..."
- San Francisco Soda Tax: A Feel-Good Policy Based on Junk Science
- Watson and Crick did not discover DNA
- Is Parenting Kids of Human and Canine Persuasion the Same? Yes!
- Diabetes: MiniMed 670G Hybrid Closed-Loop Insulin System Is A Waypoint To An Artificial Pancreas
- Celebrate Oktoberfest with Beer Chemistry
- Littlest Consumers Doing Well, Nutrition-wise
- How would you like a kitchen surface that cleans itself?
- Vitamin D could help control TB in animals
- Antipsychotic medications linked to increased risk of pneumonia in persons with Alzheimer's disease
- Multiple sclerosis misdiagnosis shows need for improved education of clinicians
- Brown adipose tissue can secrete factors that activate fat and carbohydrate metabolism