4 ms·
What is the best comment in source code you have ever encountered?
- _valeria_ 5y agoLOL //When I wrote this, only God and I understood what I was doing //Now, God only knows
- deleted 5y ago[deleted]
- Havoc 5y agoThe commentary on the fast inverse square root
- rasz 5y agoLinux driver >"Do not purchase this card, even as a joke." https://elixir.bootlin.com/linux/v3.1/source/drivers/net/3c501.c https://elixir.bootlin.com/linux/v3.1/source/drivers/net/3c5...
- atatatat 5y agoThe follow-on improvement comments, and the quick DOC section are pretty hilarious, as well.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- canistel 5y agoRecently had to go through the source code of mpg123 and found this:- /* ========================================= THE BOUNDARY OF SANITY Behold, stranger! ========================================= */
- yakubin 5y agoJoe 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 https://youtu.be/lKXe3HUG2l4?t=645>
- revolvingocelot 5y agoI didn't organically encounter it [0], but my favourite is probably * 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-understand-this.html http://catb.org/~esr/jargon/html/Y/You-are-not-expected-to-u... [1] https://archive.is/eeYMW 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_6th_Edition,_with_Source_Code#%22You_are_not_expected_to_understand_this%22 https://en.wikipedia.org/wiki/Lions%27_Commentary_on_UNIX_6t...
- beermonster 5y agoVarious 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.
- Rzor 5y agoI saw it on Stack Overflow. It was a compilation of weird and funny comments. This one was "// Magic. Do not touch"
- msarrel 5y agoWe 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.