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?
- What May Be Missing From Quantum Computing - A Quantum Middle Man
- Almost One In Three US Adults Owns A Gun But Murder Rates Have Plummeted
- Math, Time and Obesity
- Obese Teens Are Less Likely To Use Contraception
- The Missing Memristor Has NOT Been Found Published By Nature Group
- Predictive Coding Theory: How Our Brains Recognize Faces From Minimal Information
- Head Start In The South Also Helped Create Future Civil Rights Leaders
- "Where did you get that statistic? ..."
- "So from 20 times the gun linked murder rate of all other OECD countries down to 19.5 times? Still..."
- "Vegan parents investigated for neglect after baby son found severely malnourished - said they..."
- "Good news on two fronts.Although I get a kick out of insulting people now and then (OK, maybe a..."
- "Ugh, there are three paths I wish I could take this conversation now. History has taught me that..."