How salty is your code?

Hmm, I have the source to a very large commercial app handy, of the 1M+ lines- of-code size, so I just grepped it and found a few instances of F**K, but all in third-party code that had been “adopted” into the core, and apparently not been cleaned well.

// Fucking idiot user. And by that I mean me.

// Fixed [serious bug caused by numbskull coding]. SHIT. FUCK. [this bug] affects all [platform] versions from v3.0 to 4.04. SHIT.

// Note the fuckup: [fuckup explained]

// Select it into the device and copy the fucker

// Fuck sync. Its back to async.

// [commented out setting of a struct member] what the fuck was this set for?

// TODO: this is clearly wrong, but [the previous approach] is fucked up, too.

// Swap out failed. Fuck. Oh well. [throws fatal error]

There’s also a popular imaging app I’m aware of where the programmers intentionally leave comments of this sort in the code: // BULLSHIT - initials - this code is clearly wrong for the following reasons [reasons explained]. It’s basically a vulger version of a FIXME or TODO convention, but named because the code that someone found is BULLSHIT (substandard) and should be cleaned up.

This not only strikes me as not funny and potentially alarming to novice users, but just plain bad design as well. If you don’t want users to click on a script in Find mode, then DONT ALLOW the script to be clicked in Find mode.

I’m in a computer science class, so I can’t use any strong language without upsetting the teacher.

This reminds me of my compilers professor. We had to write some kind of code that hooked into his. I would see errors like “You are fucked.” Then, I searched through his code to find the error and saw

throw new Exception(“You are fucked”);

in several places. I generally found this to be annoying, because the error message didn’t tell me why I was fucked.

Hmm. Lemme think.

Curse words in my variable names? Nope, all those variables are appropriately named (using something close to Hungarian notation: m_iParamCount [actual Hungarian would be m_cParams]).

Curse words in my comments? Comments? And those would be?

Yeah, so, um, when I do write comments in my code, no salty language there either.

And anyway, the people I work for have scripts they run on any shipping code to find salty language.

I have never used profanity in any comments in my code because those are written specifically for someone else to read, and you don’t want to offend them. But I have used “interesting” names for variables, but nothing too strong. After all, some variables are indeed crap or dung or do suck.

I remember once handing in a program for a CS class at uni that was in a file named “thisbytes”. Bytes? Get it? Does that count?

While at uni, I also competed in an ACM programming competition, where you program in a team of 3 and are given a bunch of problems to solve in 6 hours. One group (as explained to me by the group after the competition) were working on a problem that required them to handle 4 or 5 different situations. They deliberately left out one of these situations, as they didn’t have the time to complete it. So instead, during this situation they had their program print out something like “Oh fuck they’re testing it”, along with more profanity.

Now, when a team finishes a program that is a solution to a problem, they submit their program and it is run by some administrator against a series of input to see if the program is correct. And of course, they tested every possible situation, and so they saw the message. The administrator is then meant to hand a piece of paper to the group explaining to the group whether their solution was successful, and if not, why. We were all wondering why at the time the admin guy walked up to the group to hand them their results, and was visibly struggling not to laugh.

Does putting in a Uni assignment with “I’m sleeping my way to the top :wink: ;)” in the comments count?

Well I thought it was funny. I used to give test programs names. Like, LetsTestThisFucker, WhyTheFuckWontYouWork, etc etc. Frustration.