- 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
frist. hope the 12$ was worth it Alex!
CAPTCHA: nulla. if(obj == nulla) { return ""a;}
Admin
Admin
Admin
TRWTF is listing "French" and "Gay" separately.
Admin
In the 8th one the camel case is wrong. It should be:
public override void ManagerElations()
Admin
TRWTF is listing my name and your name separately.
Admin
First time I see use of generic in code
Is this production redy code?
Admin
You know, I think the last one is used in the DB/IDE we use at work: one of the syntax error message reads "You are missing a '', a '', an expression or a '*'"
Glad to hear the original coder of that statement found a job elsewhere
Admin
// 10/31/00 - removing voter registration duplicate verification // ** this could be part of the reason that we // ** have been represented so poorly lately
Admin
Admin
At least the comment is correct.
Admin
Hey! I speak Gay.
Admin
Looks like someone took their CS course explaining "magic numbers are bad" literally instead of in spirit.
I can see it being very important to change everything that says it uses X number of parameters to actually use Y.
Admin
Admin
Obviously, the problem is with the abbreviated names in the hierarchy. They would be so much more readable if they were just spelled out:
There, so much more readable!
Admin
It seems to me that SimpleOfx is anything but simple, but I'll take a stab at this one:
OFX Bank message server 1 statement turn rss teenage mutant ninja turtle real super bank transaction list status teenage mutant ninja turtle transmission.
Do I win?
(Captcha: opto. This property makes my opto nerve hurt.)
Admin
Admin
I've seen something similar to the last in a COBOL code section here:
Clearly someone who didn't understand that, in COBOL, ZERO and ZEROES are just different ways of saying the same thing.
Admin
What would this mean, the number of TASK_RATE tasks in one second? If so, yeah, this is 200 for a TASK_RATE of 5 ms BUT it should be computed as 1000/TASK_RATE CONFUSED
Admin
This is exactly reason why I don't like foreach - var tends to lose context.
What it should look like:
Admin
That last one is eerily similar to the code-base I inherited about a year ago, except replace all the "safe" if blocks with try/catch blocks...
Ahh, now that's a beaute! Or the single return variant: Now if this "pattern" doesn't scream "I don't give a shit about the quality of my code", then I don't know what does...Admin
Admin
#define TASK_RATE (5) //Task rate in milliseconds
WTF? Comments in define!
Admin
+1
In order of presentation: "Male", "Neuter", "Female", "Indeterminate"?
Admin
The GetStringValue example is not a WTF, but just the result of thinking about the same cases (reference could be NULL) multiple times.
I frequently get this when I code via automatic electroencephalography input and lose concentration for a while. Most cases are caught by the optimizer; but sometimes, garbage slips through. The optimizer removes it usually, but not always. I frequently get this when I code via automatic electroencephalography input and lose concentration for a while.
Admin
"Both".
Captcha: vulputate
Admin
Admin
You wish.
Admin
The one from Ryan is not a WTF. The method may just return now, but could easily be a hook for something that needs to be done for the future. The try/catch is probably something they require as part of a process for all of their methods, and it's better to do it in advance than not do it, so later when someone makes the method do something, not only do they have to remember their task but they have to remember to add the try/catch when that's something they never have to do for an existing method. It's the same reason why coding standards saying to use curly braces on single line statements: because why make someone remember they have to do it later when you could just mitigate the risk and do it now.
Admin
Interesting how fashions change. There's lots of bollocks being talked about single line curly braces at the moment. I think it looks shit, by the way.
Used to be that the Egyptian style, a.k.a the K&R style, was king. Now suddenly it's not.
Admin
The Only WTF is that they didn't leave the application in COBOL in the first place, but tried to convert it to C.
In COBOL you don't have to write out the full parentage of a nested field like that, or have to bother with the ToString(). You would just write:
move ACCTTYPE to M-ACCOUNT-TYPE
Admin
However, in the real world, "rates" are measured in Hz, not seconds. It should be TASK_INTERVAL or TASK_PERIOD or something like that.
Well, assuming it really is in milliseconds, that is, and not work-units per unit of time.
Admin
So it has come to this... COBOL has become a better alternative than Java or C. That's just sad.
Admin
output: 5 ???
Addendum (2011-10-31 12:03): EDIT: My misconception, sorry. Steve is absolutely correct. At least I can leave pretty code to harrass those who like monochromatic comments. :P
Admin
Style is fashion - do what everyone on your project does, it'll be okay. K&R is popular in books because vertical line space is expensive in print. On the screen, vertical line space is free, and if it's an issue it's an alarm bell: time to refactor.
I prefer the One True Brace Style (Allman style) because it lets me line up the braces by eye, and makes the blocks more obvious. But whatever, in this world there are certainly bigger things to get worked up about.
Single-line braces are a belt-and-suspenders thing, at best. If you're doing everything else right, they don't make a lot of difference, and they busy up your code. If you're doing everything else wrong, they're not likely to make a lot of difference, and they busy up your code. So don't bother, I say, just do everything else right.
Admin
Reminds me of a job I had 15 years ago. I was moved onto a long running project and found myself on the "team" of a real bunch of K&R apologists. Despite my best attempts to educate them as to the merits of single line quotes they forced me to use K&R. Joke was on them though, each day I would secretly convert pieces of the code from K&R to single brace (as well as making some other more aesthetic and functional changes/improvements). Then when they went home each night I would disable the source control notification system, force commit my changes (ie overwrite the repository - this was long before CVS even) and renable the system again.
Slowly but surely the whole code base was improved (from the most obscure files upwards) and by the time they realized what had happened (weeks later) it was already too late to change it back.
Admin
Admin
What a shitty thing to do.
Admin
What, you mean responding to a troll?
Admin
Admin
Admin
The first rule of GetStringValue is return "" for (obj == null). The second rule of GetStringValue is return "" for (obj == null)! The third rule of GetStringValue is if !(obj == null) - you HAVE to fight.
Admin
Admin
Admin
I blame Obama, really...
Admin
If you're a "try this" guy, I have only one thing to say to you: Did you try thinking?
Admin
Good call. It was a knee-jerk reaction. He's a jerk, I kneed him.
Admin
added to personal vocabulary
Admin
If those shagnasty long variable names didn't come from PeopleSoft, they must at least have been autogenerated by the same convert-mainframe-COBOL-directly-to-web-2.0 utility.
Admin
Does that help?