- 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
This one is called "poor man's conditional breakpoint".
Admin
great idea - though this does take away some sidebar fodder.
Admin
yayyyyy!!
code WTFs -- lots of them!
i guess i'll have to stop complaining. what am i going to do with my time now?
Admin
Shouldn't that be twentySomethingSpaces?
captcha: awesomeness. Just like today's WTF!
Admin
twentyFiveSpaces. I'm guessing the requirements changed to require more spaces, but they didn't feel like changing the variable name everywhere it's used.
Admin
Ah, brillant. It's been a while since we've had a delightful smorgasbord of code snippets. These are all fortunately more hillarious than horrid.
I particularly like how Sunday is Admin day. I suppose they decided that it would be more empowering than Casual Fridays.
Admin
This looks to me like the developer just needed a place to stick a breakpoint so he could start stepping through the code when it got to customer #7742, so he could figure out why it was failing for that customer. At least, that's why *I've* written code like this.
Admin
Beautiful in its simple WTF'ery.
Probably this should be something like
#define DELIMITER "|"
Admin
In a loosely typed language, this could actually have an effect similar to
no? e.g., if ISend is actually (int)14, the 'wtf' line of code would convert it to a (bool)true, correct?
Admin
... which is part of the house that Jack built?
(Captcha: Chocobot. Mmmm....)
Admin
MakeCum reminds me of one of my earlier efforts, when I had to work on a fund accrual generation system, or the FAG system, which consisted of FAG customers, FAG products, FAG rates, etc...
Admin
My Favorite:
if (cust = "Wal-Mart")
order date := dateFromEDI
ship date := dateFromEDI - (dayof week(today)) + day of week
end if
so when you get to day 1, usually monday what happens?
Admin
Let's be kind and assume the missing comment is something like:
/* I'll get back to this later - in a hurry! */
Admin
Admin
Placing a non-conditional breakpoint under the if is significantly faster than placing a conditional breakpoint in the code if this is in a loop that gets executed a bunch of times (at least this was true in VS.NET 2003).
Admin
Nice!
Admin
A few projects back I worked with a girl 3 months out of school. We had some coding style rules, one of which was 'descriptive variable names'. Instead of, as you suggest, "DELIMITER", she used something like: "THE_CHARACTER_THAT_SEPARATES_FIELDS_IN_THE_PARAMETER_STRING".
Admin
Sunday is admin day is pure genius.
I can't believe I haven't seen that anywhere, before; you can bet I'm going to start using it.
Admin
Admin
I guess no regular users will use the application on Sundays, so it is safe to assume that anyone using the application on a Sunday is an admin. At least until some user figures out if he changes the date of the PC clock to Sunday then you will get full admin privileges.
Admin
Or even better, the system I worked on named by the Marketing Wonks:
CRP
Had us laughing for an hour since we definitely had the fastest CRP around
Admin
Of course, this is useful.
Imagine what would happen if the value of lSend equals FileNotFound!
Admin
See, this is *why* such code is wtf :)
If ISend is actually (int) 14, then that line of code would convert it to a (bool)false. Because it compares ISend = True, instead of just using ISend as a conditional. And they're not going to be equal.
Admin
I'm guessing that the extra spaces were from Alex's anonymisation. We wouldn't want top-secret company info leaking out.
Admin
Hmmm That's not soooo bad, I mean:
Boss: Write a module that handles .csv files (comma separated values)
Programmer: Ok
[A few days later]
Boss: Ok, here is a .csv file to try your module:
File: data;moredata;another data; etc
Programmer: .....
[More days later]
Boss: the client sent this file, almost like the ones we'll use in production
Second File: data-moredata-another data- etc.
And so on...
The easiest solution is to #define COMMA
Now I dare all of you to tellme that this never ever happened to you...
Captcha: captcha: captcha: captcha.............
Admin
Admin
How many of you counted the spaces? :)
Admin
Can... hardly... keep... a... straight... face... (All that's missing is a "catch (ValueTransitionException valTrEx) {}" block; then I would have lost it.)
I used to try to avoid the "cum" abbreviation whenever possible, but app I'm currently working on has "cumQty" variables all over the place, so I've gotten pretty desensitized to it. Now I have much more
staminatolerance for its usage.Admin
I interpret it as, anyone working on Sunday must need to get work done, and doesn't have time to screw around with potential permission issues, or getting hold of an admin to grant him permissions.
(Our non-admin users do not have the privilege to change the clock, so, we don't have to worry about the problem you describe. We only have to worry about them coming in on Sundays.)
Admin
Man, it's good to see some nice code WTF's! This is the stuff that just makes your day.
Admin
On a really basic intellectual level, programming is about coming up with elegant ways to describe things that happen. Remember, always name it what it's *for*, and *why it exists* not what exactly it does! Otherwise, why bother with any kind of structured high-level programming?
Reed
Pro
Admin
I always wanted to create a help desk system called "My Pants".
Support: "Hmm, I've never heard of that. Let me search my pants and see what I can find."
Support: "I'm sorry, My Pants is down, so I can't answer your question."
Support: "I seem to recall seeing something about that in My Pants."
The 14 year old humor possibilities are endless!
Admin
Don't forget what the Bible says ... "On the 7th day, the hackers shall rest."
Bravo, Alex! Best post in a long, long time .... thanks for giving me some good laughs on a busy Friday afternoon !
Admin
Maybe the programmer was concerned the int would be initialized with 64 bits, so he used this to try to specify a 32 bit integer, thus conserving memory.
How many comments the last few months have speculated The Daily WTF was running out of material? Ha!
Admin
This is all language dependant, in VB6 some very strange things happen with implicit conversions:
Dim i As Integer
i = 14
Dim x1, x2, x3 As Boolean
x1 = (i = True)
x2 = (True = i)
x3 = i
x1 and x2 will be false, but x3 is true?
but that really is the WTF because that iif is stil useless, could have just been
lSend = (lSend = True)
Dim i As Integer
i = 14
i = (i = True)
i will be 0 in VB6, so it can be passed to a function taht only excepts 0 or -1, at least that's my guess to the reason
Admin
"Sunday is admin day" reminds me of when I worked for a large Geographic Information System company. We had a password backdoor for the benefit of the "specialists" that we'd send out to customer sites to help them with their setup and customization. Originally, the secret password was the day of the week spelt backwards (ie "yadnus"). But our specialists couldn't get that right even if they wrote the rule on their hands, so we had to change it to a single asterisk. The specialists actually managed to remember that. Unfortunately they taught it to all the customers, so in 6 years of working there I never saw a customer using a real password.
Admin
According to a lot of spam I get, there is help available if your cumQty isn't high enough.
Admin
"The Pilot Episode" - Is that a reference to the first ever episode of The X Files?
captcha: poprocks - The first ever candy that rocked.
Admin
14 year old humour - I work with a database called "MasterData". Not that funny if you are Kiwi like my colleagues, as they pronounce data the American way (First syllable rhymes with bar). However, I'm from the UK and for me it rhymes with day. Try saying it my way, out loud...
Admin
What?
No XML ?!
<g>
Admin
I imagine it could be worse.
Someone from New England who often adds nonexistent "r" to any word ending in a vowel sound (like idear for idea) !
Admin
lucky you assigned in he order you id, seeing as you declared 2 variants and 1 boolean:
x2 would have been 14x1 = (i = True)
x3 = (True = i)
x2 = i
Admin
This was actually a boolean variable, which defaults to false in VB6. I think the original intent was to change it to true if it wasn't already, but lSend = True would have actually worked.
Admin
What Americans are you talking about? I've always pronounced it "day tuh".
Admin
Lol, nice.
Support: "Please hold. Sysadmin Julia currently has My Pants down for servicing."
Support: "I'm sorry, My Pants is a little slow today..."
Support: "I'm sorry, I can't seem to find that in My Pants."
Admin
Re the JetStar example: I don't have a problem with that -- it's expandable/updatable for the future. Harmless at worst; MIPS are cheap. Still funny, though...
Captcha: stfu
Admin
I do it too, but I don't let anyone know. I clean up after myself. The next thing you know, another drone is poking through the files checked in with my name on it looking for that kind of thing :)
captcha: random. As in random code generation.
Admin
#define PIPE ","
Admin
That's almost /too/ good. Of course, it'd be just the opposite if the following were to happen:
"I'm sorry, there seems to be a problem with My Pants today. We had to bring it down, we've been having almost non-stop core dumps this moring."
Admin
That is exactly what that is. It should have been removed during a peer review (HA!), but it's definitely not a WTF.