- 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... change to second in 2014.
Admin
At least there was a comment explaining the WTF...
Admin
The next logical step is setting a cron job to sed in the correct date every January 1.
Admin
And the comment might be completely true. "Can't be fixed otherwise" ... "because no more time is allocated to work on this task".
Admin
Frifth.
Admin
Well done Bob for analysing a reported problem (perhaps incorrectly but WTF?), committing a change and acting as 1 man band QA all within 10 minutes. It's not like he had anything better to do since he was just watching the telly when his boss rolled up..
Admin
Admin
Substituting a fixed string for the year on an otherwise library generated date string (based on the current time?), seems like a really odd thing to do.
The original author must have a reason, even though it was most likely a bad one the article might have been more interesting if we got a little post presentation analysis on why that might have been.
Admin
Finally, the best use of "TRWTF is XML" because yeah - date handling in XML is non-existent.
Admin
“I’m on in ten minutes after the president’s daughter!” The VP shouted.
Admin
This. This is how I read this line first time.
Admin
It may be a good idea to revert this change once the graph has been produced, though.
Oh, and maybe WidgetCo sell records. You never know...
Admin
Admin
My boss once told me to "wait until today" to do something. I interpreted it as "now".
Admin
They are two different persons, the VP of sales and his ''boss''.
Admin
And, for calling me "Son", as you walk into the presentation, I change the code back to what it was. I don't give a fuck who you are, being condescending (and then not even thanking me when I save your fat arse) puts you straight onto my shitlist.
Admin
There are three people in this story: Bob, Bob's boss (who told him there was a problem and grabbed his laptop), and the VP (who has the problem).
Admin
Am I the only one to recognise the Philip K. Dick reference?
Admin
This is TRWTF. Not even a thank you after saving your stupid, non-planning in advance, ass.
Admin
... Wait...
Ah, it made the graph look even more skyrockety.
Why the hell is their presentation reliant on real-time data anyway. I mean, what if the sales were per month, and it's the first day of the month on the presentation. You don't want to show that month. That's why presentation data is collected and a graph is made independent of the data.
Don't these things always have three points. It is, after all, the VP's presentation. A presentation that's telecast would not be to the VP's boss if Joe Smith can watch it too. So who the hell cares if the underlings see a profit graph. They only want a paycheck. If it is to his boss, then also, why does he need a graph. The only time you need a graph is when you're selling to clients.
Admin
"his boss approached him. “We got a big problem, and it needs to be fixed fast.” Before Bob could object, she grabbed his laptop and ushered him down the hall.
The VP of Sales stood outside the conference room where the telecast was taking place. He shoved a tablet under Bob’s nose, which showed a line graph of WidgetCo’s sales from January 2012 until now."
Two different people...Bob's boss, AND the VP of Sales...no gender switching...
Admin
Yes. But your question inspired me to create a programmer-specific Voight-Kampff test question.
Admin
He had 10 minutes to produce a "fixed" graph. Plunging into the code could easily have took too long. The goal was the save the presentation, so do this: 1- Take a screenshot of the broke graph 2- Paste into Paint.net or other 3- "Fix" the graph by editing the picture 4- Display the resulting fixed graph fullscreen
And then once the presentation is over, look at the code to fix it, and go after any thanks you feel like you deserve.
Admin
FTFY.
Admin
Admin
what country is this? we are also learning to say thank you now.
Admin
Way easier fix:
Admin
This might have been fixed properly if the previous year's meeting was on February 29.
Admin
Wait... The VP was his mom?
Do we now have a Vice President's Son to compete with the President's Daughter?
I'm completely confused now. Why aren't there opera titles for these things?
Admin
Once you reach a certain level of management, no one can read. They must be given Playmobil charts if you want them to understand your presentation.
Captcha: jumentum - Oh man, I'm not touching this one.
Admin
WHAT DO YOU MEAN, I CHANGE IT TO 2013?!
Admin
Could someone enlighten me on what the line would have been to correctly pull the date from the standard library in that code context?
I'm not familiar with csharp, and have never seen it embedded in xml. So I'm just curious.
Admin
Admin
Admin
FTFY
Admin
Probably not... she's got bodyguards and everything.
Admin
The correct fix would have been to rotate the tablet 180 degrees.
Admin
(as a super-quick fix, then analyze if there's a better way to work with the str variable)
Admin
not if you can find a cure in time
Admin
TRWTF #1:
public String getCorrectDate(String str)
Which implies that somewhere, something else has an incorrect date.
TRWTF #2: this method simply concatenates a year onto the end of the string.
Admin
Someone made something similar at my job. A Perl script had to merge several files into one single output. One of the file names included the current year.
The date was hard coded in the script and the person had added a Wiki page with documentation that said it had to be updated each year in December...
It amazes me that the person was able to know enough programming to parse and read the files, but had never thought of checking if Perl had any functions for retrieving the current year.
Admin
Wow. Astonishing lack of understanding here.
Bosses aren't problems, they are problem solvers. Admittedly, they often don't understand technical issues, that's why they are bosses (who manage people) rather than programmers (who manage code) or technicians! (who manage things) They just solve a different kind of problem than the developers.
Presumably, the boss wants to please HER boss, who wants to please the other members of the board with the wonderful news that they aren't going insolvent. OP wants to please his boss, too. It's people working together. OP did the right thing in fixing the actual (minor, easily fixed) problem which was caused by the original programmer, long, long ago and far, far away.
My $0.02?
The year was probably hard-coded for a reason. Likely, some of the crap input the WTF library is supposed to parse is missing a year, is invalidly formatted, or something.
Hard-coding the year was a really dumb answer for #1 above, but was likely just a quick hack, where the developer intended to come back and fix it, and either forgot to do so, or was fired/promoted, or even flat-out told to leave it alone.
A "right" response would be to use standard date libraries to parse the date, check the result for what appeared to be a legitimate year and return that if all is well. Otherwise return the WTF answer with a hard coded year to handle the case of #1 above. ALONG WITH COPIOUS NOTES as to why it was done.
3A) A better "right" response would be to log WTFs somehow, so that in the case where the missing year had to be filled in, that fact is logged in a standard location and available for review. That way, in a year or two, when some OTHER developer looks at the WTF alternative case, they can answer the question "Yeah, but does this ever happen?" by looking in the wtf log file with a reasonable chance of accuracy.
In our shop, we have such a function used to log such WTF situations along with debugging information generally useful enough to allow us to go thru the log from time to time and fix such stuff that was not previously understood. TL;DR we do #3A all the time.
Admin
Wait, what? I call bullshit - since when are charts and graphs in management meetings in any way related to reality?
captcha: abigo. Real time sales graphs are abigo WTF
Admin
what was that quote the other day about there always being someone trying to justify a stupid WTF...
Admin
Admin
I can't find anything on TexMex and Philip K. Dick.
Admin
No. Even we in India are recognizing it. In fact, it is having seemed so trivial as not to deserve a mention, just as a citation from well-known play "Hamlet" might be allowed to pass unnoticed. However, the entire subcontinent applauds your perspicuity in noting this reference to well-known and widely-loved author.
Admin
WidgetCo was a poor choice for anonymizing the company name. There are several WidgetCos out there.
Admin
God, I wish it would. It hasn't been funny in months.
Admin
They're just questions, Meh. In answer to your query, they’re written down for me. It’s a test, designed to provoke an emotional response. Shall we continue?