- 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
The only relevant response is this: bottom fish banana.
Admin
*bangs head on desk
Admin
Comment line 1 is in date format
("Maybe I'm frist").
Admin
well, the logic behind this is, uhm...
a) nonexistent b) fuzzy c) an indicator of what horrors might be hidden on that codebase d) a testimony to the higher-ups's stupidity, for not allowing such crap to be overwritten with something sane e) all of the above
Admin
My favorite part is the nonsensical "&& string.IsNullOrEmpty(processingClient.StreetAddress.Line1)" in the outer if.
Admin
I have a fix for you. a /* before the for statement, a */ at the end of it. Replace with nothing.
CAPTCHA: paratus, pair of what you say?
Admin
I'm sure there's a street somewhere in Liverpool called "Octopus Gardens..."
This code is quite brillant, in fact. It goes way beyond the traditional temptation to be "paid by the line." It's actually the first WTF I've seen that clearly has no possible utility whatsoever.
Admin
Btw, what language is that? String, string and IsNullOrEmpty suggest C#, but the
for (String month : months)
is not C#-y. Anonymization gone wrong?Admin
More validation is always better. We can't have our data jumpin' around all nimbly-bimbly from tree to tree...
Admin
Hope there's no October Road in Scunthorpe.
Admin
I wondered why I couldn't order anything off you guys.
Regards
Jane Doe 42 Juliet Place Marchwood
Admin
Great stuff, there has to be a ton of street names that will run foul of this: Mayflower Juliet Mars
Admin
FTFY, It should work now.
Admin
Whoops, missed one.
Admin
http://thedailywtf.com/Articles/The_Brillant_Paula_Bean.aspx and http://thedailywtf.com/Articles/The_Brillant_Paula_Strikes_Back.aspx will fix that. http://thedailywtf.com/Articles/Web_0_0x2e_1.aspx can help unless you want to be very stubborn.
Admin
Damn, thats what i was going to put but comments were not working..... at least they are working now: ("Comment Line %i is in date format", &line)
Admin
Admin
Admin
Admin
I have absolutely no idea as to why anyone would do that to their system, but I guess that the developers did not grow up in my hometown:
Google map link to a load of streets, all named after months ...
Admin
Source line 3 is in date format ( "Jan", "Feb", "Mar", ). Source line 4 is in date format ( "Apr", "May", "Jun", ). Source line 5 is in date format ( "Jul", "Aug", "Sep", ). Source line 6 is in date format ( "Oct", "Nov", "Dec").
Admin
And I'd thought you boycotted our whole town ...
Admin
I can guess what happened here. The database was initially seeded from a whole bunch of externally-supplied files, some of which were in a format different from what was expected, having dates where addresses were expected. We've done similar things in the past.
In order for the app to detect that such a file was of that format, this snippet was written (by an intern, as this is the sort of thing you give rookies to program). Unfortunately, due to some configuration management mistake, it made it to production. And the guy who was initially behind this code snippet (the bloke who initially told the intern / student what to do) is no longer around.
Admin
Admin
And C++ has the flexibility (C macros, overloading) to impersonate other languages or combination of languages.
Although, it could be J#.
Admin
There seems to be as little logic to that street layout as to the code snippet.
If you're walking along Nørregyde you get: Jul Jan Feb Aug Mar Sep Oct May Apr.
If you do it N->S it's: Apr May Jan Feb Mar Jul Aug Sep Oct
I haven't managed to find June and it seems they couldn't be bothered to finish the sequence off with Nov & Dec?
Admin
This system is clearly in need of some upgrades - it isn't even internationalized to support multiple languages...
What if someone enters a date in french?!?
Admin
I'm not talking about WTFs that clearly fail to do what they're supposed to do. I'mm talking about this WTF being so useless that, as the OP said, it's impossible to work out what problem the stupid thing was meant to do in the first place.
Admin
BA: The users want the system to identify addresses that may be dates.
DEV: Wha!?!?!?
BA: The users want the system to identify addresses that may be dates.
DEV: That sounds pretty dumb, what problem are they trying to solve?
BA: That the system doesn't identify addresses that may be dates.
DEV: Uh...but...
This is just an example of what happens when you are given solutions instead of requirements.
Admin
There. I fixed it.
Admin
I suspect the intent of this code is to scold the user if they accidentally fill in the address line 1 with a date (i.e. the field above is a date field and they occasionally run into issues with people misaligning their information).
Admin
Couldn't it also be written in D ? (although this one hasn't been used a lot ^^)
Admin
Wow. Standing ovation. This one's an instant classic.
Admin
Admin
Good point. In that case DateTime.TryParse() or it's equivalent would be much more appropriate than that crap.
Admin
Admin
Is this supposed to be "!string.IsNullOrEmpty()"? Since this loop will only run if Line1 is null or empty, the condition "processingClient.StreetAddress.Line1 != null && processingClient.StreetAddress.Line1.Contains(month)" will always be false, won't it? Unless month is the empty string, in which case it will always be true (I think--I'm not sure if every string Contains the empty string, but I suspect they do).
Admin
Admin
“Our codebase is a bit... backwards, to say the least,” writes Aaron Silver, “things that should go up don’t go up or down... instead, they&rsqou;re painted orange .”
Admin
Admin
The thing is... the whole block is only called if processingClient.StreetAddress.Line1 is null or empty, so if that's the case why would they decide that it needed a check to see if it contains a month? And why is it OK for lines to contain months if line1 is NOT null or empty?
Admin
Not sure what you mean about every string containing the empty string. If you call the 'Contains' method on an empty string (ie length=0), it will only match another empty string (ie length=0).
Admin
If you listen carefully, you'll notice the Beatles got their apostrophes right.
I'd like to be under the sea In an octopus's garden in the shade He'd let us in, knows where we've been In his octopus's garden in the shade
Just the one octopus, so it takes "'s"
Admin
+1. One of those must be the explanation.
Admin
Actually, now I come to think about it, the lyrics don't just repeat the "octopus's garden" line like that. The point stands though.
Admin
Admin
rsquo ’ U+2019 (8217) HTML 4.0 HTMLspecial ISOnum right single quotation mark
Presumably put in the html as ’ as we see it like that.
So random testing will be unlikely to find the problem.
WTFIFWWY !
Admin
Steve Holt!
Admin
Admin
Except it doesn't negate the check, so it'll never happen.