- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
if (myPrivates.size() != othersPrivates.size() || ! myPrivates.containsAll(othersPrivates) || ! othersPrivates.containsAll(myPrivates)) {
I'm wondering why this isn't something like:
if (!myPrivates.equals(othersPrivates)) {
Which does pretty much the same thing in Java's standard library.
Admin
it depends on the equals implementation of TIntSet: are we sure it's actually a Java Set?
Admin
If myPrivates come first that's a good thing, right?
Admin
Lots of people don't know that, or don't trust it, is why (assuming this code is Java but it definitely looks like it).
Admin
Considering everything I've ever learned about privates, better is != same. Better is actually > same.
Admin
So, in essence, the WTF here is that
myPrivates
andothersPrivates
weren't calledmyPrivateSignatures
andothersPrivateSignatures
??? (With a few bonus points for not using the.equals
method?)Weak weak weak.
(I've seen worse variable-naming WTFs, like the guy who celebrated buying a new car by naming a key variable in a primitive embedded multithreading system after it. The worst part?
golf_gti
. Tells you all you need to know about the guy.)Admin
In Ada, parts of some constructs are private (not visible from the outside). Story goes that the French lead designer had had his leg pulled so often by the Brits in the team that he refused to believe that "private parts" was probably not the best name for these constructs.
Admin
So, "private parts" are not visible from outside? Sounds modest to me.
Admin
You, sir, obviously have a much less childish sense of humour than the rest of us.
If it helps, try reading the code out loud in a Beavis & Butthead voice ...
Admin
Not a WTF, but made me smile more than the regular WTFs. :D
Also: next opportunity I get, I'm using this!
Admin
Nah, I got that part(1), but it's still a weak WTF.
(1) I've been known to comment that in C++, if you're a class, then you and your friends can grope your private parts...
Admin
He's comparing the size of his privates to the size of the other's privates. That's some serious insecurity there (and we all know we should write more secure code).
Admin
Maybe sometimes we can just post something funny without it being inherently wrong.
Admin
Looks like he's down with O.P.P.
Admin
The original formulation is "your friend can touch your private parts."
Call me prissy, but "grope" doesn't work so well. Maybe "manipulate?"
Admin
I think that "grope" perfectly captures the kind of touching that I don't want people doing if they are "just" friends.
Admin
In our code a variable is actually named after me. The programmer thought it would be funny.
Admin
In our old code where variable names needed to be short we had an rather poor choice of abbreviation for AnalyseMessage (I'll let you work it out)
Admin
| myPrivates.containsAll(othersPrivates)
That's going to be painful if you're a dude.
Admin
That's awesome. At the company I previously worked at one of the older guys had written a program quite a few years before I had even started there that was used to analyze raw log files. The exe was called RawAnal.exe. Cracked me the hell up when I found it in the code repo. I asked him about it passing one day and he chuckled.
Admin
It's going to be painful for someone involved no matter what parts they have!
Admin
Many years ago I had to strip html from files. I made a Stripper class and called stripper.strip()
Admin
An oops of mine from back in the stone age. I was writing code for dealing with a plotter. (Those of you who don't know what they are can get off my lawn! They're not quite gone.) I had written code using the variable PenIs before I realized what it spelled.
Admin
There is a company selling pens with the addition island to the name (http://www.PenIsland.net)
Admin
And of course who can forget the Stack Overflow of the 2000s, ExpertSexchange
Admin
DQ isn't a very informative variable name...
Admin
Well, was, apparently. What's there now is clearly a parody. "We Specialize In Wood" indeed...
Admin
At first I read that class as "TinySet"
Admin
Eons ago a friend and his wife were playing Scrabble on a real physical board, the one that rotated like a Lazy Susan. She, with the board facing towards her, played "PENIS" vertically. He, looking at the board upside down, loudly protested that "Penis (rhymes with 'tennis') isn't a word!". She, sensing blood, says "Oh yeah, are you sure you're sure???". "Hell yes I'm sure! You lose your turn for an illegal word!". She sloooowly rotates the board around to face his way.
I'm told the argument lasted an hour but the makeup sex was *awesome *.
And no, I'm not the "friend". Really.
Admin
myPrivates.containsAll(othersPrivates), but one at a time please.
Admin
Wouldn't be as funny then. Some jokes are funny only through repetition.