Barry rolled into work at 8:30AM to see the project manager waiting at the door, wringing her hands and sweating. She paced a bit while Barry badged in, and then immediately explained the issue:
Today was a major release of their new features. This wasn't just a mere software change; the new release was tied to major changes to a new product line- actual widgets rolling off an assembly line right now. And those changes didn't work.
"I thought we tested this," Barry said.
"We did! And Stu called in sick today!"
Stu was the senior developer on the project, who had written most of the new code.
"I talked to him for a few minutes, and he's convinced it's a data issue. Something in the metadata or something?"
"I'll take a look," Barry said.
He skipped grabbing a coffee from the carafe and dove straight in.
Prior to the recent project, the code had looked something like this:
if (IsProduct1(_productId))
_programId = 1;
elseif (IsProduct2(_productId))
_programId = 2;
elseif (IsProduct3(_productId))
_programId = 3;
Part of the project, however, was about changing the workflow for "Product 3". So Stu had written this code:
if (IsProduct1(_productId))
_programId = 1;
else if (IsProduct2(_productId))
_programId = 2;
else if (IsProduct3(_productId))
_programId = 3;
DoSomethingProductId3Specific1();
DoSomethingProductId3Specific2();
DoSomethingProductId3Specific3();
Since this is C# and not Python, it took Barry all of 5 seconds to spot this and figure out what the problem was and fix it:
if (IsProduct1(_productId))
{
_programId = 1;
}
else if (IsProduct2(_productId))
{
_programId = 2;
}
else if (IsProduct3(_productId))
{
_programId = 3;
DoSomethingProductId3Specific1();
DoSomethingProductId3Specific2();
DoSomethingProductId3Specific3();
}
This brings us to about 8:32. Now, given the problems, Barry wasn't about to just push this change- in addition to running pipeline tests (and writing tests that Stu clearly hadn't), he pinged the head of QA to get a tester on this fix ASAP. Everyone worked quickly, and that meant by 9:30 the fix was considered good and ready to be merged in and pushed to production. Sometime in there, while waiting for a pipeline to complete, Barry managed to grab a cup of coffee to wake himself up.
While Barry was busy with that, Stu had decided that he wasn't feeling that sick after all, and had rolled into the office around 9:00. Which meant that just as Barry was about to push the button to run the release pipeline, an "URGENT" email came in from Stu.
"Hey, everybody, I fixed that bug. Can we get this released ASAP?"
Barry went ahead and released the version that he'd already tested, but out of morbid curiosity, went and checked Stu's fix.
if (IsProduct1(_productId))
_programId = 1;
else if (IsProduct2(_productId))
_programId = 2;
else if (IsProduct3(_productId))
{
_programId = 3;
}
if (IsProduct3(_productId))
{
DoSomethingProductId3Specific1();
DoSomethingProductId3Specific2();
DoSomethingProductId3Specific3();
}
At least this version would have worked, though I'm not sure Stu fully understands what "{}"s mean in C#. Or in most programming languages, if we're being honest.
With Barry's work, the launch went off just a few minutes later than the scheduled time. Since the launch was successful, at the next company "all hands", the leadership team made sure to congratulate the people instrumental in making it happen: that is to say, the lead developer of the project, Stu.