In the struggle to meet deadlines, I think pretty much all programmers have put in comments they might later regret, including swearwords and acerbic comments about other code or requirements. Also, any conscientious coder will put in prominent comments warning others about the trickier parts of the code. Comments like “UGLY TERRIBLE HACK” tend to indicate good code rather than bad: in bad code ugly terrible hacks are considered par for the course. It would therefore be both hypocritical and meaningless to go through the comments looking for embarrassments. But also fun, so let’s go.The overall conclusion is rather flattering towards Microsoft: a lot of good code, with the obligatory ugly hacks for compatibility with other stuff. No stolen open source, either. Better go have a look before their cease-and-desist shows up.
Linux kernel swear counts: Someone grepped out all the bad words in the Linux kernel source. If I'm reading the graph right, "crap" appears to be the clear winner, appearing about once every 130 lines of code in the 2.6 kernel. Sadly, this method lacks the eloquence of the commenting…
My absolute favorite:
"The magnitude of this hack compares favorably with that of the national debt."