|
|
|
| Non-WTF Job: Interface Designer/Front-end Developer at Naviance (DC) |
| « The Service Awards Ceremony | I Think I'm Going To Be Sick » |
K. K. sent in an example of his company's naming conventions for methods, in which if you have a method that's used frequently, you repeat part of its name for dramatic effect.
"Back in the days when assembly ruled the world, there were some not so straightforward ways widely employed to set a register to zero," Ilya writes. "For instance, 'xor ax,ax' or 'and r[0],0'." Imagine Ilya's surprise when he found out that creative techniques are still in use in modern languages.
float sp = car[0].act.speed; sp -= sp; car[0].act.speed = sp;
I can only assume that the above snippet is what was used to stop a car when going in reverse in Big Rigs: Over the Road Racing.
Finally, Jeff S. (one of our more active forum members) sent in two quickies from two separate applications he'd inherited:
<h2 class="head3">Order Summary</h2>
And from a database schema:
CREATE TABLE Properties ( /* SNIP */ RegionID INT NOT NULL REFERENCES Regions(RegionID), RealRegionID INT NOT NULL REFERENCES Regions(RegionID), /* SNIP */ )
The real WTF is that he forgot a NoDudeSeriouslyRealRegionID column.
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). |
[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 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 |
| « The Service Awards Ceremony | I Think I'm Going To Be Sick » |