• (cs)

    Frist... change to second in 2014.

  • anonim (unregistered)

    At least there was a comment explaining the WTF...

  • anon (unregistered)

    The next logical step is setting a cron job to sed in the correct date every January 1.

  • Gyxi (unregistered)

    And the comment might be completely true. "Can't be fixed otherwise" ... "because no more time is allocated to work on this task".

  • (cs)

    Frifth.

  • meh (unregistered)

    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..

  • anonymous (unregistered) in reply to Gyxi
    Gyxi:
    And the comment might be completely true. "Can't be fixed otherwise" ... "because no more time is allocated to work on this task".
    Maybe last year the author also had only 10 minutes before the presentation began.
  • Geoff (unregistered)

    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.

  • Dan Morrison (unregistered)

    Finally, the best use of "TRWTF is XML" because yeah - date handling in XML is non-existent.

  • Thanatos Complex (unregistered)

    “I’m on in ten minutes after the president’s daughter!” The VP shouted.

  • (cs) in reply to Thanatos Complex
    Thanatos Complex:
    “I’m on in ten minutes after the president’s daughter!” The VP shouted.

    This. This is how I read this line first time.

  • moz (unregistered) in reply to Geoff
    Geoff:
    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.
    The VP wants a squiggle which could pass as a sales graph. He's got one now. What else do you need to know?

    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...

  • anon123 (unregistered)
    Before Bob could object, she grabbed his laptop and ushered him down the hall. [...] The VP of Sales snatched away his tablet, not even thanking Bob before he walked inside to give his speech.
    TRWTF is obviously that Bob's change altered VP's gender. That's what you get with committing stuff without testing first!
  • Andrew (unregistered)

    My boss once told me to "wait until today" to do something. I interpreted it as "now".

  • anon (unregistered) in reply to anon123

    They are two different persons, the VP of sales and his ''boss''.

  • MrBester (unregistered)

    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.

  • WizardStan (unregistered) in reply to anon123

    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).

  • QJo (unregistered)

    Am I the only one to recognise the Philip K. Dick reference?

  • (cs)
    The VP of Sales snatched away his tablet, not even thanking Bob before he walked inside to give his speech.

    This is TRWTF. Not even a thank you after saving your stupid, non-planning in advance, ass.

  • (cs)

    ... Wait...

    1. If changing the year from 2012 to 2013 made the new sales show up, what happened to the old sales.

    Ah, it made the graph look even more skyrockety.

    1. 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.

    2. 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.

  • lb (unregistered) in reply to anon123

    "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...

  • (cs) in reply to QJo
    QJo:
    Am I the only one to recognise the Philip K. Dick reference?

    Yes. But your question inspired me to create a programmer-specific Voight-Kampff test question.

    You're walking through the desert. You come upon a widget that hard-codes the year to 2012. You change it to hard-code the date to 2013, then commit your change.
  • Valrandir (unregistered)

    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.

  • (cs) in reply to anonymous
    anonymous:
    Gyxi:
    And the comment might be completely true. "Can't be fixed otherwise" ... "because no more time is allocated to work on this task".
    Maybe last year the author also had only 10 minutes before the president's daughter.

    FTFY.

  • (cs) in reply to WizardStan
    WizardStan:
    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 was the problem).
    There, FTFY.
  • (cs)

    what country is this? we are also learning to say thank you now.

  • neminem (unregistered) in reply to Valrandir
    Valrandir:
    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

    Way easier fix:

    1. Generate a graph from last year. Nobody would know the difference.
    2. Profit.
  • ¯\(°_o)/¯ I DUNNO LOL (unregistered)

    This might have been fixed properly if the previous year's meeting was on February 29.

  • (cs)

    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?

  • Anon (unregistered) in reply to xaade
    xaade:
    ... 3. 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.

    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.

  • meh (unregistered) in reply to dgvid
    dgvid:
    QJo:
    Am I the only one to recognise the Philip K. Dick reference?

    Yes. But your question inspired me to create a programmer-specific Voight-Kampff test question.

    You're walking through the desert. You come upon a widget that hard-codes the year to 2012. You change it to hard-code the date to 2013, then commit your change.

    WHAT DO YOU MEAN, I CHANGE IT TO 2013?!

  • mag (unregistered)

    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.

  • (cs) in reply to Thanatos Complex
    Thanatos Complex:
    “I’m on in ten minutes after the president’s daughter!” The VP shouted.
    Jeez, that one just isn't going to ever die, is it‽
  • (cs) in reply to QJo
    QJo:
    Am I the only one to recognise the Philip K. Dick reference?
    Please enlighten those of use who are not Dick-heads.
  • Anon (unregistered) in reply to Thanatos Complex
    Thanatos Complex:
    “I’m on the president’s daughter in ten minutes!” The VP shouted.

    FTFY

  • (cs) in reply to SamC
    SamC:
    Thanatos Complex:
    “I’m on in ten minutes after the president’s daughter!” The VP shouted.
    Jeez, that one just isn't going to ever die, is it‽

    Probably not... she's got bodyguards and everything.

  • (cs)

    The correct fix would have been to rotate the tablet 180 degrees.

  • (cs) in reply to mag
    mag:
    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.

        public String getCorrectDate(String str) 
        {
          return str.Substring(0,10) + " " + System.DateTime.Today.Year.ToString();
        }
    

    (as a super-quick fix, then analyze if there's a better way to work with the str variable)

  • Ironside (unregistered) in reply to SamC
    SamC:
    Thanatos Complex:
    “I’m on in ten minutes after the president’s daughter!” The VP shouted.
    Jeez, that one just isn't going to ever die, is it‽

    not if you can find a cure in time

  • dguthurts (unregistered)

    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.

  • Been there, seen that (unregistered)

    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.

  • Benjamin Smith (unregistered) in reply to Steve The Cynic
    Steve The Cynic:
    WizardStan:
    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 was the problem).
    There, FTFY.

    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?

    1. 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.

    2. 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.

    3. 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.

  • dilligaf (unregistered)

    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

  • (cs) in reply to Benjamin Smith
    Benjamin Smith:
    Steve The Cynic:
    WizardStan:
    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 was the problem).
    There, FTFY.

    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?

    1. 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.

    2. 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.

    3. 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.

    what was that quote the other day about there always being someone trying to justify a stupid WTF...

  • (cs) in reply to R.Flowers
    R.Flowers:
    QJo:
    Am I the only one to recognise the Philip K. Dick reference?
    Please enlighten those of use who are not Dick-heads.
    Google is your fucking friend, shit-for-brains.
  • (cs)

    I can't find anything on TexMex and Philip K. Dick.

  • Not Necessarily the Nagesh (unregistered) in reply to QJo
    QJo:
    Am I the only one to recognise the Philip K. Dick reference?

    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.

  • Been there, seen that (unregistered)

    WidgetCo was a poor choice for anonymizing the company name. There are several WidgetCos out there.

  • Jazz (unregistered) in reply to SamC
    SamC:
    Thanatos Complex:
    “I’m on in ten minutes after the president’s daughter!” The VP shouted.
    Jeez, that one just isn't going to ever die, is it‽

    God, I wish it would. It hasn't been funny in months.

  • Eric K. (unregistered) in reply to meh

    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?

Leave a comment on “Now Wait for Next GetYear()”

Log In or post as a guest

Replying to comment #:

« Return to Article