- 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
Makes me hope somewhere, someplace, I can find one of those 'code drawings' from the obfuscation competitions materialise organically in shitty, shitty code.
Admin
Ow, my brain...
Admin
Only a Lovecraft quote can express how this code makes me feel.
I could not help feeling that they were evil things -- mountains of madness whose farther slopes looked out over some accursed abyss.
Admin
Not only this developer used Goto, which is enough to deserve a slow and painful death, but he wasn't even able to use it properly... why create 88 labels (with no real name of course) when only one would be enough?
Anyway, VB.NET is a WTF by itself...
Admin
Who is Ellis Morning? Did he win your competition about the cat that set the computer on fire?
Admin
Admin
Unless I'm reading it wrong (or it was copy/pasted incorrectly), there's an even bigger WTF
It never gets to checking for "WSST" or later, because the 'goto label1' bypasses all that
Admin
Ellis is the first of several new sames you'll see around. We're still slowly going through the various submissions. It also wasn't a competition. There's no winner- everyone gets a participation ribbon.
Admin
Not that it exemplifies its use in this case, but goto is actually not The Devil. It does have its place (but mostly only in C).
Admin
That and the infinite indentation has me think this is generated code.
Admin
But TRWTF is when programmers create a vast mess of super-nested conditionals and boolean variables just to avoid a single goto. Yeah, goto can be harmful, but so can the things that people do to avoid it…
Admin
This developer has 88 problems, but a regex ain't one.
Admin
A developer has 88 problems. Then they say, "I know, I'll use a regex." Now they have 89 problems.
Admin
This code makes my particles hurt.
Admin
There comes a point in every programmer's life where you find yourself wondering "Can this possibly be the best way to do this? Should it really be this difficult? Am I actually so special and unique that I'm the first person in the history of history to encounter this problem?"
If you don't know how to wonder, you are not a programmer. Please step back from the keyboard. Now.
Admin
o_O Blink
Admin
The problem here is, as hinted at above, that the if/else if/else chain is badly broken, with every other else if having been replaced by a simple if. This leads the code to grossly misbehave, and I'd imagine that it returns Now() most of the time.
(simple: it normally fails to remove the incorrect time zone symbol from the string, and therefore the Parse() call will throw an exception, dumping us in the catch, which doesn't do anything.)
That said, I think that throwing is a good plan in this case, rather than returning an arbitrary value. And if you are going to return an arbitrary value, 25 o'clock on 7 September 1752 is far better than Now().
For those who don't get it, here is a calendar page for September 1752:
Admin
Admin
This WTF had a very clear purpose and it succeeded.
It invalidated all previous posts on thedailywtf.
Admin
Admin
Admin
So TRWTF is in the video label62 is misaligned, right?
Admin
Reno: ran on A-I-X, a prehistoric memory. Cathy: was a Linux-freak she liked that kind of misery. Vicky: had this special way of turning gotos into loops. Camella: couldn't program, and the metre here is the real WTF.
Admin
The different labels are important for flexibility and future extensions. Right now many labels points to the same code, but when the calendar changes in the future, you might need different code for the different labels.
It's actually quite brillant.
Admin
Of course those backward countries that still use the metric system need to get with the times. Decimal? Excuse me? Something allegedly logical yet based on a number that can't be cut in quarters? And the length of a meter being based on how long a pendulum has to be to swing in one second -- which in turn is not a decimal measure?
No, the "SI" metric system is a hopeless unfounded mess. Why any civilized nation still uses it is beyond me.
Admin
Judging by the sample, they would then have 176 problems.
Admin
Admin
Sounds like you got a binder full of women.
Admin
Admin
Admin
GOTO does not need to be used in modern day languages. Unles s you want to open up a can of worms in your code.
Admin
89 problems, but a switch ain't one?
Admin
Found the true WTF: There's an indentation error at "label 162"! ;-)
Admin
setjmp longjmp
Try and handle driver exceptions without them...
Admin
Three hours gone now and nobody cares.
Why should they when not even the compiler does?
Admin
Something isn't consistent.
Admin
I don't think his father used a switch on him often enough.
Admin
Or you might be using SwedishJava, which you can test for by looking at the month of February 1712. If you are using SwedishJava, this month will have 30 days.
Of course, in no version of Java should the GregorianCalendar object be able to parse a date before 1582.
Admin
in football, this is called a stretch play.
Admin
Admin
The name dateTimeFromJavaXml suggest the way the code was generated: they took a java library, serialized result for all possible data into XML and then reverse engineered a VBA version of it.
That, or "decompiled" it.
Admin
That is not the problem with this code. The problem with this code is that it doesn't use any of the very nice libraries that clever people who think a lot about time have written to handle all these interesting time issues.
Admin
How original of you to be afraid of the replacement for C syntax.
My friends and I compiled a list of the worst words in programming. "Goto" topped the list, just ahead of "robust" and "rich."
Code smells: http://www.codinghorror.com/blog/2006/05/code-smells.html
Ones with space programs, yes.
The great thing about programs is that they do exactly what you tell them to do. So if you have a bad human using a program, you're going to get this as a result. Garbage in, garbage out.
That's not an issue of modern languages, it's just low-level versus high-level languages. We've progressed to the point where most modern languages are high-level, and yes, writing driver code in those is a WTF.
Admin
I'm pretty sure D-Coder was being sarcastic talking about a program doing things "willingly". Or did they add a compiler option to VB.Net that I'm not aware of?
Admin
The technological singularity happened in in 2008. :D
But yeah, I was agreeing with him. (yes, that can happen on this site)
Admin
Not plain wrong, but definitely not true. It depends a little on your idea of a "modern day language" -- most sensible usage of goto i have seen so far was C. But even in C#, I once had a case where goto made the code much simpler and a lot more legible.
Rule of thumb "avoid goto" is ok, but "ban goto, no matter what" is stupid.
Admin
Some people should just have been strangled at birth.
Admin
Admin
Admin