What is the best comment in source code you have ever encountered?(stackoverflow.com)
stackoverflow.com
What is the best comment in source code you have ever encountered?
https://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered
13 comments
We used to have a lot of comments, as in hundreds, that said "update this comment with more professional language" and this was 2 years after we were in production.
I saw it on Stack Overflow. It was a compilation of weird and funny comments. This one was "// Magic. Do not touch"
Various forms of:
/* DO NOT remove the following line of code */
..followed by a seemingly innocuous line of code, which if removed all hell breaks loose.
/* DO NOT remove the following line of code */
..followed by a seemingly innocuous line of code, which if removed all hell breaks loose.
The commentary on the fast inverse square root
LOL
//When I wrote this, only God and I understood what I was doing //Now, God only knows
//When I wrote this, only God and I understood what I was doing //Now, God only knows
[deleted]
Linux driver
>"Do not purchase this card, even as a joke."
https://elixir.bootlin.com/linux/v3.1/source/drivers/net/3c5...
>"Do not purchase this card, even as a joke."
https://elixir.bootlin.com/linux/v3.1/source/drivers/net/3c5...
The follow-on improvement comments, and the quick DOC section are pretty hilarious, as well.
[deleted]
[deleted]
Recently had to go through the source code of mpg123 and found this:-
/* =========================================
THE BOUNDARY OF SANITY
Behold, stranger!
========================================= */Joe Armstrong in his talk "The Mess We're In"[1]:
> Robert Virding, who developed Erlang with me, was famed for his comment... I think he only... Singular... The entire stuff he wrote had one comment. In the middle of a pattern-matching compiler was a single line that said "And now for the tricky bit"
[1]: <https://youtu.be/lKXe3HUG2l4?t=645>
> Robert Virding, who developed Erlang with me, was famed for his comment... I think he only... Singular... The entire stuff he wrote had one comment. In the middle of a pattern-matching compiler was a single line that said "And now for the tricky bit"
[1]: <https://youtu.be/lKXe3HUG2l4?t=645>
I didn't organically encounter it [0], but my favourite is probably
[0] http://catb.org/~esr/jargon/html/Y/You-are-not-expected-to-u...
[1] https://archive.is/eeYMW <- this is the dead hyperlink "explained this in detail" in the Hacker's Dictionary link above
[2] https://en.wikipedia.org/wiki/Lions%27_Commentary_on_UNIX_6t...
* You are not expected to understand this.
I find the ultimately misplaced confidence [1] of the comment quietly inspiring, in the context of who wrote it. Even the titans of yesteryear fallaciously convince themselves that, hey, the code works fine, let's get going, and consequently have to bash their heads against some weird quirk they're unintentionally exploiting (and then just rewrite the whole thing).[0] http://catb.org/~esr/jargon/html/Y/You-are-not-expected-to-u...
[1] https://archive.is/eeYMW <- this is the dead hyperlink "explained this in detail" in the Hacker's Dictionary link above
[2] https://en.wikipedia.org/wiki/Lions%27_Commentary_on_UNIX_6t...