- 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
The Real WTF is that Jake has already told us the Real WTF so the commenters will have to give the No Dude Seriously Real WTF.
Admin
I think you'll find that it's actually GetTheRealWTFCaseTheRealWTF.
Admin
I once worked on a codebase where a function run() called another function doRun() which called another function doDoRunRunRun(). (Perhaps unsurprisingly, the project was doomed).
Admin
The first one looks like a lot of functions which just pass the function name to a sql-server and return the result. Kind of prepared statements. shudder
Admin
That's stupid. Everyone knows you name functions like that ADoRunRunRunADoRunRun()
Admin
http://en.wikipedia.org/wiki/Da_Doo_Ron_Ron
Admin
You met it on a Monday and your heart stood still. The doRunRunRun(), the doRunRun().
Admin
Admin
The shear stupidity astounds you still. The doRunRunRun(), the doRunRun(). ...
Lets make a full song out of this. Perhaps I'll even write some music for it after.
Admin
The SQL may not be a total WTF. In my job, I have seen similar things where the RealRegionID might assign it to a geographical region and the RegionID might be used to assign it to a specific Regional Manager. I think these might be instances where a manager is moved from one region to an adjacent one and for whatever reason, they maintain responsibility for some of the sites in their previous region.
Admin
GoKMartInCincinnatiKmartInCincinnatiGottaGoKMart()
Admin
[Edit] ParkinT's addition which mine responds to but wasn't actually quoted in the post I replied to: Someone told you it was written by a coder named 'Jill' The doRunRunRun(), the doRunRun().
[and now mine] You can't really blame her, she had a codebase to fill. The doRunRunRun(), the doRunRun().
Admin
Did you spot the two spelling mistakes? WFField and WFTracking Entry obviously should read WTFField and WTFTrackingEntry.
Admin
Yes my heart stood still Yes her name was Jill And when she redirected me to 127.0.0.1 The doRunRunRun(), the doRunRun().
Admin
Those aren't even methods; they're classes.
Admin
And we computer nerds wonder why nobody understands our brand of humor. :D
Admin
Admin
was the product called Gabriel?
Admin
YOU'RE WINNER
Admin
TheNewRealWTF is TheNewRealWTF2 is TheRevampedWTF is TheRevampedWTF2 is TheRealWTF3_0 is TheRealWTF3_0new is TheNewRealWTF3_0new is RunRunLolaRunLolaRun
Admin
SendCommentToTDWTFSendToTDWTFCommentToTDWTF
Admin
Someone explain the "zero" wtf?
Is it because they're using floating point math (therefore causing the result to not be exactly zero)?
Admin
It is because the three lines could be perfectly abbreviated to
...would even be faster.
Admin
Admin
if (day_of_week.equals("Monday")) { if (suitor_name.equals("Phil") { doDoRunRunRun() doDoRunRun() } }
Admin
Other than creating a completely unnecessary variable, the guy called
which meansOf course, it always evaluates to 0. Why couldn't he just use car[0].act.speed = 0; is beyond me
Admin
I get your joke, and why people are perplexed by the article... but this isn't a case of reimplementing the same function over and over. These do likely correlate with Stored Procedures or something akin to such, but this is just a bad case of not knowing how to use function overloading. I've done this very thing before (don't hate), but on the database side. The idea was depending on what information you had, you had a different stored procedure to get your result, because, well, your database server doesn't have stored procedure overloading...
"GetCases" for instance is likely to return multitudes of records. But if you have a WorkflowID to filter some of it down, you would use "GetCasesWorkflow". Got a UserID too? "GetCasesWorkflowUser". Don't want to see any Cases older than 5 years old? "GetCasesWorkflowUserFilterBy"... etc etc etc
Admin
Yes, and since function overloading is not to be invented for the next fifty years....
Oh, wait...
Admin
It wouldn't surprise me to learn that there is some floating point implementation in which x - x = 0 isn't a guarantee.
I would bet against it being true, but I wouldn't be surprised to be wrong about it.
Admin
So you will have lost you bet in all IEEE floating point implementations.
If x is NaN, x-x is also NaN.
Cheers
Admin
I'm kinda surprised people seem to miss this post - more so because it's true (look at the icons).
Admin
That's absolutely right. This is from .NET, where a method is represented by a little pink isometric cube.
I'm doing research on API usability right now (this site is a gold mine!) and this looks very similar to common SOAP web service API patterns.
To keep their web methods extensible many web service companies only send in one parameter with the method, and then that parameter is an class with "child" classes, which also have children, etc. Then you can add any new "parameters" without breaking old code, or overloading parameters in a weird chronological order that doesn't make sense. So to tell people how to assemble the data structure that the SOAP XML message sends in, web service API designers sometimes encode the assembly information into the name, like so:
Customer cust = new Customer(); Customer.Selection = new CustomerSelection(); Customer.Selection.Name = new CustomerSelectionName(); Customer.Selection.Name.FirstName = "Bob";
Then they ship out "cust" as a parameter. If you wanted to change the service to add functionality to support a SecondName or ThirdName, all old code would still work. Also, the autocomplete would fill with:
Customer CustomerSelection CustomerSelectionName etc.
So here TRWTF is either (1) this actually ISN'T a web service namespace and the resemblance is bizarre, or (2) current web service stub generators are so primitive the only way to get parameters assembled correctly is to hand developers these wacky lego-block naming schemes.
Extra credit if you know what a "Whiz-Dull" is. :)
Admin
Voila. And since most modern languages support nullable primitives, you only need one code-level method to support this. No overloading necessary.
Overloading generally isn't the best solution to, well, anything. But as the saying goes, when all you have is a hammer...
Admin
As a person that suffers from multiple repeat syndrome (MRS) I find this article insensitive and offensive.
As a person that suffers from multiple repeat syndrome (MRS) I find this article insensitive and offensive.
Sincerely Pete Repete
Sincerely Pete Repete
Admin
Do you know my friend "Pete Repeat"?
He wrote just like you, except he had better spelling.
Admin
"Wizz-dull" or WSDL would be Web Service Definition Language.
Admin
Admin
Admin
I use a similar naming method for stored procedures: ObjectVerbByQualifiers, or IdeaVerbByQualifiers. Such as: SurveyUpdate, or AnswerGetByQuestionId. They can kind of get long winded though when you have intermediate tables linked to several tables.
But the reason I brought it up was because I think I remember a WTF where someone mentioned that method as a WTF. Can't find it, though... so I can't remember why it was a WTF. Maybe it was just a really long name.
Admin
Bullox. You completely assume this is all coming out of one table. What if, for each extra param, you had a join onto another table... not so big, you can just use an IF of some sort... but then you are taking a purely single-query-and-nothing-else Stored Procedure, which tends to get optimized, or "planned" well ahead of time, to evaluated code, which I know of several RDBMS's coughInterbasecough that then refuse to construct a plan, because the result or the path to the result isn't determinable ahead of time.
Admin
To be honest, I'm not sure that the HTML is actually a WTF. I presume the idea is that it's a level 2 header but the class is h3? Surely this could simply be a case of having multiple header styles and the coder just wishing to use the 3rd one?
Admin
Actually, he just left out the next column. Once you see it, you'll agree the schema makes sense:
Yes, I am customer 462846 - 6i.
Admin
I was thinking the same thing? What's wrong with using a different class for the High Explosives AD #3?
Admin
The real WTF is Stored Procedures for dynamic selects in the comments.
Admin
Obviously so he can get that little bit of floating point error at the end... he doesn't want 0 he wants 1.432322323E-14!
Admin
This is different from mysql_*_escape_string... how? There's precedent! Bad precedent, but precedent.
Admin
when sp is NaN or Infinity, sp - sp evaluates to NaN.
Admin
So,
If car[0].act.speed="smokin" <-- see, not a number!
is evaluated earlier in the program.
car[0].act.speed=0
would be incorrect.
Admin
Admin