|
|
|
| Non-WTF Job: Interface Designer/Front-end Developer at Naviance (DC) |
| « Prev | Page 1 | Page 2 | Next » |
|
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.
|
Re: A Method by Any Other Name
2008-04-09 08:09
•
by
No Dude, Seriously
(unregistered)
|
I think you'll find that it's actually GetTheRealWTFCaseTheRealWTF. |
Re: A Method by Any Other Name
2008-04-09 08:14
•
by
tragomaskhalos
(unregistered)
|
|
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). |
|
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*
|
That's stupid. Everyone knows you name functions like that ADoRunRunRunADoRunRun() |
Re: A Method by Any Other Name
2008-04-09 08:23
•
by
Livid Gibbon
(unregistered)
|
Makes more sense if you sing it: http://en.wikipedia.org/wiki/Da_Doo_Ron_Ron |
You met it on a Monday and your heart stood still. The doRunRunRun(), the doRunRun(). |
Someone told you it was written by a coder named 'Jill' The doRunRunRun(), the doRunRun() |
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. |
|
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.
|
|
GoKMartInCincinnatiKmartInCincinnatiGottaGoKMart()
|
[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(). |
Re: A Method by Any Other Name
2008-04-09 08:50
•
by
WTFNameWTFNameWTFNameWTFNameWTFName
(unregistered)
|
|
Did you spot the two spelling mistakes? WFField and WFTracking Entry obviously should read WTFField and WTFTrackingEntry.
|
Re: A Method by Any Other Name
2008-04-09 08:52
•
by
Matt
(unregistered)
|
Yes my heart stood still Yes her name was Jill And when she redirected me to 127.0.0.1 The doRunRunRun(), the doRunRun(). |
|
Those aren't even methods; they're classes.
|
And we computer nerds wonder why nobody understands our brand of humor. :D |
Re: A Method by Any Other Name
2008-04-09 09:02
•
by
Livid Gibbon
(unregistered)
|
Yeah she was paid by the line, Yeah so her approach was fine |
Re: A Method by Any Other Name
2008-04-09 09:08
•
by
kaya
(unregistered)
|
|
was the product called Gabriel?
|
|
YOU'RE
WINNER |
|
TheNewRealWTF is
TheNewRealWTF2 is TheRevampedWTF is TheRevampedWTF2 is TheRealWTF3_0 is TheRealWTF3_0new is TheNewRealWTF3_0new is RunRunLolaRunLolaRun |
|
SendCommentToTDWTFSendToTDWTFCommentToTDWTF
|
|
Someone explain the "zero" wtf?
Is it because they're using floating point math (therefore causing the result to not be exactly zero)? |
Re: A Method by Any Other Name
2008-04-09 09:44
•
by
Anonymous
(unregistered)
|
|
It is because the three lines could be perfectly abbreviated to
car[0].act.speed = 0; ...would even be faster. |
Re: A Method by Any Other Name
2008-04-09 09:53
•
by
Even Faster Zero Speed
(unregistered)
|
But "even faster" and "speed is zero" don't quite mix. That must be why it took them three lines of code to set the speed to zero. |
Re: A Method by Any Other Name
2008-04-09 09:54
•
by
silent d
(unregistered)
|
if (day_of_week.equals("Monday")) { if (suitor_name.equals("Phil") { doDoRunRunRun() doDoRunRun() } } |
Re: A Method by Any Other Name
2008-04-09 09:59
•
by
Smash
(unregistered)
|
|
Other than creating a completely unnecessary variable, the guy called
sp -= sp;which means sp = sp - sp; Of course, it always evaluates to 0. Why couldn't he just use car[0].act.speed = 0; is beyond me |
Re: A Method by Any Other Name
2008-04-09 10:00
•
by
MindChild
(unregistered)
|
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 |
Re: A Method by Any Other Name
2008-04-09 10:05
•
by
Just another bloke
(unregistered)
|
|
Yes, and since function overloading is not to be invented for the next fifty years....
Oh, wait... |
|
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. |
Re: A Method by Any Other Name
2008-04-09 10:19
•
by
fred
(unregistered)
|
So you will have lost you bet in all IEEE floating point implementations. If x is NaN, x-x is also NaN. Cheers |
I'm kinda surprised people seem to miss this post - more so because it's true (look at the icons). |
Re: A Method by Any Other Name
2008-04-09 10:28
•
by
Jack CMU
(unregistered)
|
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. :) |
Or you could do the entire thing with one GetCases procedure. CREATE PROCEDURE dbo.GetCases 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... |
|
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 |
Re: A Method by Any Other Name
2008-04-09 10:43
•
by
anonymous
(unregistered)
|
|
Do you know my friend "Pete Repeat"?
He wrote just like you, except he had better spelling. |
|
"Wizz-dull" or WSDL would be Web Service Definition Language.
|
Re: A Method by Any Other Name
2008-04-09 10:45
•
by
TakeASeatOverThere
|
Obviously it was supposed to be a robotic running dodo. Too bad the AIBO came out first. |
In The Olden (Golden) Days, before all this OOP clap trap was pOOPed upon us from ivory towers, if sp was a float and sufficiently small or large, that operation would not return 0.0 |
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. |
Re: A Method by Any Other Name
2008-04-09 10:52
•
by
MindChild
(unregistered)
|
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 *cough*Interbase*cough* that then refuse to construct a plan, because the result or the path to the result isn't determinable ahead of time. |
Re: A Method by Any Other Name
2008-04-09 11:03
•
by
Derek Hartley
(unregistered)
|
|
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?
|
Re: A Method by Any Other Name
2008-04-09 11:37
•
by
Some Mathematician
(unregistered)
|
Actually, he just left out the next column. Once you see it, you'll agree the schema makes sense: CREATE TABLE Properties ( /* SNIP */ RegionID INT NOT NULL REFERENCES Regions(RegionID), RealRegionID INT NOT NULL REFERENCES Regions(RegionID), ComplexRegionID INT NOT NULL REFERENCES Regions(RegionID), /* SNIP */ ) Yes, I am customer 462846 - 6i. |
|
I was thinking the same thing? What's wrong with using a different class for the High Explosives AD #3?
|
|
The real WTF is Stored Procedures for dynamic selects in the comments.
|
Re: A Method by Any Other Name
2008-04-09 12:14
•
by
JUST ANOTHER WTF
(unregistered)
|
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! |
This is different from mysql_*_escape_string... how? There's precedent! Bad precedent, but precedent. |
Re: A Method by Any Other Name
2008-04-09 12:26
•
by
Anonymous
(unregistered)
|
when sp is NaN or Infinity, sp - sp evaluates to NaN. |
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. |
You deserve to be quoted at least once. |
Nonsense. It means nothing unusual happened while you were in the restroom. |
| « Prev | Page 1 | Page 2 | Next » |