At a previous company, legend had it that swear words in code were banned because of an incident. A vendor was called in to debug a platform error which led to a code review. In the code reviewed, there were many expletives cussing out the vendor for undocumented behavior in their platform.

In the infamous Windows source code leak, a shitload of the swears and profanity in comments are about "Those idiots in the Office team"