Bob was watching the sales telecast for WidgetCo when 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. The graph took an enormous plummet on January 1, 2013. “Son, this has got to be fixed, or I won’t have a graph to show our record sales!”
Why did you wait until the day of the presentation to look at your data? Bob pushed this thought aside. “Let me get set up and start digging--”
“I’m on in ten minutes after the president’s done!” The VP shouted.
Bob sighed, consigned to saving the VP’s ego, and began to dig.
T-minus 10. The line graph in their internal reporting software created instances of the Sale class, which read from XML records. Sale called a custom library called WidgetDate to parse dates.
T-minus 6. WidgetDate used TexMexWidgetBlob, a God Object in an ancient library written before WidgetCo went national, in another repo entirely.
T-minus 2. Deep in TexMexWidgetBlob’s atrocious repo was the method that actually parses dates for the reporting software.
<msxsl:script language="CSharp" implements-prefix="user"> <msxsl:assembly name="System.Web" /> <msxsl:using namespace="System.Web" /> <![CDATA[ public String getCorrectDate(String str) { return str.Substring(0,10) + " 2012"; //can't be fixed otherwise .. change in 2013 } ]]> </msxsl:script>
Bob had a minute left. Why did the original programmer replace the year value? Was there an issue with how the XML dates were formatted? Bob decided to trust the Std library with his job on the line.
Bob crossed his fingers, committed the change, and refreshed the graph. The 2013 sales were there, in their middling, non-record glory. The VP of Sales snatched away his tablet, not even thanking Bob before he walked inside to give his speech.
![](https://thedailywtf.com/images/inedo/buildmaster-icon.png)