- 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
//Comment (boring, funny, first - default value is none) public String comment;
Admin
//Status (true, false - default value is FileNotFound) public boolean status;
Admin
That's got to be the most succinct WTF I've seen in a while. I love the longer stories but the short ones leave the rest to your imagination.
Admin
[code] //Status (true, false, maybe - default value is FileNotFound) public Boolean statis; [/code0
FTFY
Admin
At least the peer review process is working well...
Admin
FTFM
CATPCHA: conventio -- this article. as in this article is very conventio.
Admin
The real WTF is that someone will probably post a comment claiming this isn't a WTF.
Captcha: eros - finally a captcha I can endorse wholeheartedly.
Admin
Okay, so he made the status a string. Probably not the best option; I'd have used an enum or something. Also, it being a string with (I'd expect) a finite range of possible values, making it public probably isn't a good choice either. Words like "best practice" and "quality" certainly don't come to mind here. But I suppose it'll work, as long as no one abuses the unneeded flexibility of a public string.
I can appreciate that the comment lists the range of possible values for status (probably the only "best practice" shown), although my prior observations leave me doubtful of the comment's accuracy. So at this point, unless I'm missing something obvious I'd almost say that it's "not really a WTF".
Except then I examine the following bit:
Someone please find this code's author and shoot him.Admin
Admin
Fixed?
Admin
Admin
Admin
Admin
Admin
var comment:String = new String(); comment = "this post sucked"; trace("Alex, come on.");
Yes, I know my post is as lame as the article, but I'm not very inspired. But this "article" wasn't either.
No redacted reference to what this "large logistics company" was. (Fedex? UPS?) Or even the slightest reference to what part of the code that logic applied to. Even if it was a general function, a little more back store would make it more entertaining reading.
I guess it's the whole "Representative Line" theme. But in my likely to be flamed opinion, this line represents nothing to me.
Captcha: refoveo Red rover, red rover, come oveo and gimme a better wtf.
Admin
And you're not forgiven for you incorrect use of the word "your".
Captcha: Ingenium...perhaps your use of the word was "ingenium".
Admin
There may well be cases where a string is the best status, I'd say that in most cases its a poor choice. I prefer my types to indicate something useful. Certainly, thats no basis for impuning someone's real world experience.
Admin
Did I mention I hated this article? Maybe it's the Christmas anti spirit.
Deck the forums with balls of stupid, fa la la la la.
Noel, noel, no elohel.
The First no elohel, the Angels didn't say Was to certain poor posters in fields as they say In fields where they lay keeping their posts up to date On a cold Wednesday day that was so deep. elohel, elohel, elohel, elohel Born is the King of Weak Posting!
Captcha: tation Temptation to be more abbreviated.
Admin
True WTF is the CIA W.T.F.
Admin
default value = false means that there IS NO default value!!!
Admin
FTFY
Admin
As many have alluded to with the "default value = none" comments, I hope.
Seriously though, if this was the worst WTF that could be found in the entire codebase... then you must be one whiny and weak programmer. Especially considering that with zero context, 50% of the commenters here have been able to come up with a logical and well-fitting explanation for the comment+code line.
That's not to say that those 2 lines aren't poor, lazy, or both... just that they're really weak for a "representative" wtf.
Admin
//Status (none, active, finished - default value is wtf) public String status;
Admin
And the fact that the entire J2EE world is basically one big WTF is a defense how, exactly?
Admin
Almost:
There we go. Very enterprisey.
Admin
Perhaps this was your code?
Admin
Do explain.
Admin
Admin
Admin
Well we don't know what the string is used for, perhaps it is the value that is being displayed to the user. A string seems slightly better than an enum in that case.
TRWTF is the story. The code base is apparently a heaping mass of dung, and the representative line is a comment that isn't quite accurate? Seriously? Is the problem a lot of comments that are wrong, or that it uses a lot of public variables?
Man if this is the worst the code has to offer, AND it sums it all up, then the code is probably pretty nice.
Admin
Honestly though, you're right; it's hard to say what the best option would have been without seeing the code in context.
Admin
Admin
Admin
Dun Duh Dun Duh Dun Duh YOU'RE DUMB!
Admin
Admin
I think you got you're your's mixed up their, buddy.
Admin
Muphrey's Law... Every fuck time! It almost never fails.
PS: How can I make something bold in this forum???
Admin
Admin
Admin
This is the real WTF...
Admin
Admin
Good Lord, what a bunch of banal replies...
Admin
Standard BBCOde...Square braces [] bold not bold
Admin
Admin
I have to assume the mistake was deliberate....
misspelling (mis prefixed to spelling)
The wiggly red line underneath tells you that it's spelt (spelled, apparently) wrong
Admin
Who hasn't written a comment like this?
Admin
Admin
+1 for "enterprisey"
Admin
Admin