What is the best comment in source code you have ever encountered?
Join Stack Overflow to learn, share knowledge, and build your career.
closed as not constructive by Bill the Lizard Aug 4 '11 at 12:13As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question. |
|||
|
|
|||
|
From: https://github.com/zepouet/Xee-xCode-4.5/blob/master/XeePhotoshopLoader.m#L108
|
|||||||||||||||||||||
|
|
I am particularly guilty of this, embedding non-constructive comments, code poetry and little jokes into most of my projects (although I usually have enough sense to remove anything directly offensive before releasing the code). Here's one I'm particulary fond of, placed far, far down a poorly-designed 'God Object':
I'M SORRY!!!! I just couldn't help myself.....! And another, which I'll admit I haven't actually released into the wild, even though I am very tempted to do so in one of my less intuitive classes:
|
|||||||||||||||||||||
|
|
||||
|
|
And I just found this one today:
|
|||||||||||||||||||||
|
|
When coding MAPPER Apps we had some standards and one of these was that there was a list of standard variables in use throughout the suite. One of these - 'V43' was always used to hold a Surname. So imagine my annoyance when the only comment in a big cryptic chunk of MAPPER code I'd been asked to fix was:
|
||||
|
|
|
||||
|
|
|
Some old fortran code I saw:
|
||||
|
|
|
||||
|
|
followed shortly thereafter by:
|
||||
|
|
|
||||
|
|
The process in question was a service in some legacy code |
||||
|
|
|
||||
|
|
|
First at the beginning of an Update to a huge object:
Then after some 200 lines of logic to update the object:
And the developer was right... This sucked HARD! |
||||
|
|
|
||||
|
|
|
||||
|
|
|
I often found this one
|
||||
|
|
|
I've just placed this comment:
|
||||
|
|
|
||||
|
|
|
||||
|
|
|
||||
|
|
|
||||
|
|
|
||||
|
|
|
||||
|
|
|
BerkeleyDB
|
||||
|
|
|
||||
|
|
|
at the end of a rather long and convoluted set of while loops and if blocks, the developer in question inserted this final comment:
a laconic mixture of wit and sarcasm :) |
||||
|
|
|
In Latin, |
|||||||||
|
This comment was posted above a huge while-if-for block... Oh, and it manipulated an object array of object arrays of object arrays of strings that could be strings or numbers, depending on at least 3 factors... (yes, I had to debug this code and change it and I wrote the comment, however I did not write the original code). ;) |
||||
|
|
|
||||
|
|
|
Technically not a comment, but from coding on something at 2 am or so:
... that variable is never used again EVER and appears in the beginning of a listen loop for a socket. |
|||||
|