4 ms·
Ask HN: Are Funny Code Comments Useful?
I am wondering if anyone has worked on an open-source project where people, regularly, included a little humor in their code.
Did this make the project go faster, and development more fun, or was it just distracting?
Funny examples of your own would be appreciated.
- nickmolnar 18y agoI just found this. Apparently the Linux kernel is primarily written by sailors. http://www.vidarholen.net/contents/wordcount/ http://www.vidarholen.net/contents/wordcount/
- silentbicycle 18y ago/* WTF IS THIS */ can actually speak volumes about code, though.
- lbrandy 18y agoOf course they are. Humor is useful. We tracked down a bug in our code the other day to one of the hard-coded internal constants being too high... It had the comment "I sort of just made this up. Probably worth testing." If it had been commentless, we would have worried by moving it we'd fix our use-case but break some other use-case.
- gabrielroth 18y agoWhat's useful there is not the humor but the information.
- silentbicycle 18y agoI don't think that's an example of humor in comments -- it's just saying, "I'm not sure this is right, you should test it." That's pretty important, actually. I think the question is more about comments that are just puns or something, like: p = point(w, 0, 0); /* woo hoo! */
- maryrosecook 18y agoI ocasionally find myself writing, "Warning: obscenely hackalicious hackety hack", or something similar. When I come across it later, it makes me laugh and makes me refactor.