- 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
This isn't quite as bad as it looks at frist*. It's mostly just a single function that has too many parameters. Making it a macro might make it easier to read, since you could replace all of the repeated object properties (which is what makes the line so long) with a few variables. Changing the parameters to be a few objects and then using the properties inside the function would also help a lot.
Admin
As sometimes happens, TRWTF is the way the article is written here.
Frist of all, the author should have broken the lines on commas, not at convenient dots. Doing that, and discarding all the repeated jibberjabber, we end up with this:
And that's much easier to follow.
Admin
It is, nonetheless, as noted by @Dragnslcr, a function with an uncomfortably large number of parameters.
Aaaannnd, I was snecod...
Admin
"I do not know exactly what this is doing" Paid by the character, and time it takes to complete.
Admin
Trying desperately to find a silver lining in this abomination, I will admit that the names are more meaningful than I expected.
Admin
The implication of the article is that there were no line breaks at all in the original.
Yes, discarding the WTFery makes it not a WTF. That's pretty much true of any WTF.
Admin
One of the 12 parameters is the sum of two values. Another parameter appears to be the value returned from a function that requires four parameters. That's a lot of parameters, but that's not exactly WTFery.
TRWTF is having a function that takes 12 parameters, but you have to pass 16 values to make it work.
Admin
This is what happens when you don't have objects or intermediate values. For an Excel abomination it's not bad.
16 values are needed to do the calculation (although four can be calculated to a single value), that calls out for structuring somehow--but Excel decidedly does not excel in doing that.
Admin
As a fun activity, I tried writing a more readable drop-in replacement without addressing any underlying issues.
Admin
"As a fun activity," -- You have an interesting idea of "fun activity". :)
Admin
PartPart as a name (or fragment thereof) is a WTF all by itself
Admin
I propose using
PartPartas the programming equivalent of the MoonMoon meme.