- 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
What does the first paragraph has to do with the code snippet???
Admin
I think that covers it, really. We've heard of Hungarian ... Backwards Hungarian? Wrong Hungarian?
Admin
I think the hungarianness is the smallest WTF on this line.
Admin
If you've ever seen programs written by physicists...you'll know this ain't nothing
Captcha Jumentum - There's energy mommentum and jumentum
Admin
Not the worst, but definitely deserves to be here. This kind of rounding can't be done well after formatting it as a string, so without a special formatter, this approach would be sound. There is however a DecimalFormat in Java, which is much better. As for bugs, I only see that it may miss some trailing zeros, are there any other?
Admin
"Wrongarian," surely.
Admin
Admin
Good luck, Jeremy. They seem to be everwhere...
Admin
I'm starting to get annoyed at the implicit assumption that many of tdwtf articles make that anyone who is tasked with working on poor or legacy code should, and will, naturally immediately abandon ship and seek a new job. Legacy code is something that has to be dealt with for any project that's been around for a while. A job is a job and having to work on crap for a while (especially at a "first job") really should be expected.
Admin
I love the function name, btw.
Admin
If Bugcourse will be used entirely or even 4 times out of 5, I'm gonna resign. I think Erik would be more than happy to fill in for me. Or Remy.
Admin
I would elect not to read it.
Admin
The problem isn't that the legacy code is legacy. The problem is that no one ever bothers fixing any of it or devoting any time to understanding it, leaving the New Guy to parse page after page of the worst garbage devkind has ever produced.
If you're going to make new coders sift through garbage you've been too lazy to handle, it indicates that you don't actually give a damn about them, or your codebase.
Admin
Maybe that's why they hired a new guy: Because no one had time to fix or even understand the legacy code. But instead of fixing the code and get rid of one huge WTF the new guy quits the job. I don't think with that kind of working morale he doesn't last long in his new job either.
Admin
Admin
No, snoofle, I'll resign too if Discourse becomes staple of this site. Erik can have both of our jobs, if he wants it. I'm done here.
Admin
Actually, I like it if you are using application Hungarian instead of system Hungarian, eg "customerID".
Admin
The commented lines won't help, since the correct answer is to not even use this function.
Also, Java is TRWTF.
Admin
In some shops you aren't allowed to fix code unless there is a ticket for it.
Re-factoring and cleaning cruft are usually found dead by the road leading to better jobs...
Admin
One of them even had the goto line numbering in a random order, and the author's attempt at indentation was to massively indent the first line and then have every subsequent line in the block at the left-hand margin.
Admin
A "Hung Wrongarian" (and don't call me Shirley!)...
Admin
On legacy code:
Never enough time to do it "right", but always enough money to "do it over". This IS the problem, sometimes legacy code is more concise and doesn't need to be altered. The "new guy" (I just finished a stint doing that!) usually wants to re-factor the code and "make it better", but the inertia to do so is EXTREME and then someone mentions "risk" and it all gets shot down. So spaghetti code accreted over the years of "fixes" that "just work" continue, and nobody wants to touch the pile of stinky stuff!
Life goes on. We get new jobs. (SIGH)
Admin
Admin
That's the weirdest random function I've ever seen.
Admin
it's camelCase, nothing wrong with it when used in the correct context.
Admin
Admin
It's only legacy code when there's not enough time or money to do it over. It's still brand new code when there's not enough time or money to do it right the first time.