- 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
At that point, you don't know what the requirements are. You're at the mercy of going and asking users what it is supposed to do.
If you really have to do that...
... you're looking at a rewrite.
Admin
If you're one of the people who read the last Sergio article and said TDWTF was finished...
then why the fsck are you still here?
Admin
Because Obi Wan Kenobi is our last hope?
Admin
Replacement WTF that I just came across:
Admin
Admin
What's the "WTF"? This is obviously from some financial or tax program; 'PR' is often a valid 'State' abbreviation for tax purposes.
Admin
PR definitely is valid, as is DC.
Admin
First, you need to know why something was built the way it was. Maybe he spends a few hundred hours writing sane code, only to discover that sane code doesn't work, at all, with any of the other systems he can't touch in any way.
Like tearing out beams in a house without first determining whether they're simply decorative or holding up the roof.
Admin
They've left WY off the end? That's a typo, not a WTF.
Admin
Admin
Admin
Would you propose a second and third single element array for "districts" and "territories", then looping over the arrays? Or would pulling an XML table from a No-SQL database be more correct IYO?
Admin
Design a country subdivision provider, restrict it to have all of the necessary business logic, then put that same logic in the database, which takes three calls to generate the necessary options. And store that data as XML in the database.
Admin
Agreed. I don't get new devs' "refactor all the things my way" approach to everything.
If you change legacy code that works fine because you think you can write it better, but you AREN'T sure what the code does, or if it's written that way for a reason, then sooner or later you're going to cause a major problem.
Admin
I said that on the first installment of the trilogy, yet we had to painfully endure three of them to reach the obvious conclusion?
Captcha: genitus... yeah, that's me!
Admin
The Daily WTF is a small, privately-run humor site in Ohio. Alex Papallamdamolous is the sole editor of software managing hundreds of WTFs. Missing a sense of humor, he tracks down his predecessors for help.
"Just one left."
Alex scrolled through several dozen pages of submissions, collected over three months on the job at Daily WTF. His efforts to track down his predecessors had given him little insight, but he had been able to muddle through the swamp of anti-humor in the articles.
But the last name, Erik Gern, still eluded him.
A Madman's Prose
"He only lasted a week," Snoofle said. "He quit the day before we called you for an interview."
"Well, he wrote thousands of WTFs," Alex said. "I think he checked in about 9,000 lines before he left. And most of them don't even make sense!" Alex pointed to a line he had HTML commented, followed by unicorns. "That article you pointed out three months ago, where he couldn't tell the difference between a ninja and a samurai? That's his fault."
Admin
Admin
I never thought I'd find myself saying this, but I think this site'd be better off just running Classic WTFs until they can find an author who can write stories without tons of pointless embellishment.
I mean, Bastard Operator From Hell and The Codeless Code veer closer to reality than this.
Admin
Yours Truly, //SYSDEL DD DSN=BAD.USERS.DIR
Admin
"this app was written by madmen and fools"
As a Computer Professional (tm), I find this to be a true statement. Daily. For all values of "this".
Admin
Admin
CODE REVIEW THE PLANET
Admin
Admin
Admin
American Samoa is excluded because the 14th amendment only gives citizenship to people who are born in states like DC and PR and some others. Anyone know the status of Guam? Barry Obama is lucky he's not Barry Goldwater, whose candidacy really was in doubt because Arizona wasn't a state when he was born.
Admin
Admin
I was mainly a Coboller on mini's, but was transitioning into systems programming on mainframes and doing simple admin tasks. I used JCL here and there to do my stuff.
I went to a job interview that wanted a Coboller. They asked the usual Cobol crap. Then they asked "do you use JCL". "Yes". "How do you create a JCL script?" "I copy a script that does what I want, and change the variables, like everyone else does."
Needless to say, I didn't get the job.
Admin
On the plus side, we now have an easy way to determine just how many scrapers The Daily WTF has got. Simply feed "casa de quixote" as an exact string into the search engine of your choice...
Captcha: Would any of these words seem hard to read if I did not happen to have a degree in Classics? Somehow I think not.
Admin
So the WTF is the story telling not the story right?
Admin
... but if you find the opportunity to reduce the size of a source file to a considerably smaller size by implementing a loop, you should just do it -- unless of course it's time-critical in a bottleneck. If the code quality of the whole application is clearly substandard, then it's a fair bet that it won't be.
If you can't work out what the code does by studying it, then you're in the wrong job and perhaps you ought to consider a career in application of makeup or retail of footwear.
Admin
I really feel like it someone wrote that did it for an high school assignemnent. You know, related to the book they just read...
Anyhow, please find another way of publishing stories than this. Just a list of ugly website would be probably far better than Don quixote or hockey...
Admin
Yes. If Sergio had spent the time he did "tracking down" previous developers (during his working hours, I assume?!) actually fixing the damn thing... he could've even finished fixing it before he resigned.
Admin
I cannot believe how many people totally missed the point of this story.
Which is: When you inherit code full of WTF's, it is a fool's game--tilting at windmills--to try to find someone to blame. You either live with the code you inherited, improving where possible, or else you move on.
It doesn't matter if the previous programmers disappeared into the vapor or if they're still around writing more WTF's. Your choices are the same: Live with it or go.
In fact: If you stick around someplace long enough (>12 months) you'll be inheriting your own code. If you are honest with yourself in trying to evaluate and improve your own work, you will find it to be full of WTF's.
For example, just today, I was looking at some library code I wrote just 18 months ago and smacked myself in the forehead, "WTF was I thinking?" It needs rework, because I must have had a real bad day at the code factory. The worst thing is, I can sort of remember doing that code sequence, and convincing myself--at the time--that it was sane.
We don't always have perfect knowledge, nor do we always apply it perfectly. We work in a profession that rarely achieves perfection: Live with it, improving where possible, or move on.
Admin
But do you know where your towel is?
Admin
Admin
Alex: Don't do multi-part stories. If a person doesn't like the first part, they're less likely to read the second part. If a person doesn't like the second part, they're less likely to read the third part. Every extra part you add makes it that much more likely that you'll lose readers.
If the stories aren't connected to each other so strictly, however, you won't have so much of a problem.
Admin
Admin
You're worried about 1k of hard drive space? On any sufficiently large project you can never be sure it isn't ___ way for one reason or another. Even if you're certain you're replacing the exact semantics with different syntax, there's always the chance you cause a bug.
For better or worse the code that has been out there for x years is battle tested and battle hardened. Yours isn't. In almost all cases where you're just "doing it better" for the sake of doing it better, you should probably just leave well enough alone.
Admin
With the odds stacked against them, they'll have to get help from the most unlikely allies. "Do not try to bend the requirements. That is impossible. Instead, only try to realise the truth: there are no requirements, and it is yourself that bends."
This summer ...
"Do you know what they call a pull request in Paris?"
... prepare yourself ...
eyelids flutter "I know Perl" "Show me"
... for an adventure ...
"You want specifications?" "I want the users!" "You can't handle the users!"
... that will change you forever.
"I've had enough of these motherfcking bugs on this motherfckign project!" cut to black
THE LAST DEVELOPER
"You're gonna need a bigger server"
Admin
Did you even see this article? With how poorly it was written, you should have cringed and skipped the remainder of the story. Missing the point of the story was forced by its poor quality.
Admin
var a = 23 + arg2; if (a + arg1 + 54 == 23) { b = arg1; } if (a + arg1 + 55 == 23) { b = arg1 + 1; } if (a + arg1 + 57 == 23) { b = arg1 + 2; } if (a + arg1 + 58 == 23) { b = arg1 + 3; } if (a + arg1 + 59 == 23) { b = arg1 + 4; }
Oh comon, you can't figure out what that does???
So you just implement a loop right?
Oops, you just broke the legacy code. The code that has been working for 30 years. Why did you have to touch it? Was that mandatory?
Admin
Anyways, once I decided I didn't want to work a bunch of free overtime for a gaggle of code that would disappear in a few of years, I learned to apply "if it ain't broke, don't fix it" much more judiciously.
Admin
Admin
Picture a programmer in his repose, exposed to excessive and unrealistically detailed programming documentation. With no referents to reality, he goes mad -- he fancies such tomes to be normal, even a desirable end in themselves. Unable to ignore the romantic notions of chivalrous programming that cloud his thoughts, he somehow finds another companion who shares his delusions and pays him to perpetuate them.
Faced with a dragon of a system that has neither rhyme, reason, nor documentation, his madness leads him on three doomed Sallies -- the first to a skyscraper, where he had little chance of success, even if he had actually visited on a weekday. On his second sally, he travels many miles to track down a shady character in some dodgy tavern.
Undaunted by the mounting failures that result from his epic misconceptions, he makes his third and fateful sally, but finally he catches a glimpse of the truth, like a long-lost oasis.
As the trilogy ends, our hero finally realizes the system is insane, and he must abandon it, yet in so doing still fails to grasp the folly of his labors to rationalize it.Admin
I can't agree.
First of all, I have respect for the individuals who have day jobs but expend their personal time on this site to try to entertain us as guests.
Second, one of the time-honored approaches to authorship is called the "homage", of which this is an example. All homages are necessarily somewhat forced because, to be a proper homage, the story must borrow elements of the original work such as plot elements, language elements, and setting elements. These must be woven in and around the new elements of the story to create a familiar feel, which is hard to do.
Third, the original story from which this derives was probably quite limited. I think it is creative that the author of these articles recognized the theme that story offered, and that it would be possible to turn it into an homage.
Finally, despite the homage framework and limitations the original story likely had, the author managed to retain a clear theme throughout the expanded version.
On the whole, I enjoyed it; and I'm sorry you weren't able to enjoy it as well.
Admin
Nice try Erik Gern
Admin
Oh look, erik took offense and deleted a ton of negative comments. Maybe if he would take the comments seriously he would improve his writing.
Admin
My analogy would be that missing what you think is "TRWTF" is like not noticing that your doctor has a new haircut while he's giving you a prostate exam.
Admin
There was a typo when the array was typed out (WY left off the end).
50+DC+PR = 52
The list was typed (or copied), and WY was missed.
Then the list items were counted, and 51 was used. Since the first-thought of most people is "50 states", not "50 states+DC", they figured "50 states+PR" and didn't think again about it needing to be 52.
That's not a "WTF". A "WTF" would be including, say, 'UK', or having a list of US States that was, say, [40].
Admin