DevDisasters
Skills.Equals(null)
Software development gone wrong.
All eyes were on Darrell as he swaggered past the rows of cubicles. Darrell was different than the other developers -- sharply dressed in an expensive suit with designer sunglasses dangling from his breast pocket. He left shortly after arriving with a huge smile on his face.
The interview had gone well. The company -- a midsize logistics software provider out of New England -- had been falling behind schedule and delivering their custom reporting tools with more and more bugs. Darrell had successfully sold himself as the company's savior who could improve code quality and deliver faster than the others.
Darrell was a C# guru who would work for no less than almost double what the other contractors were paid. Even better for Darrell, he'd get to work from home, remoting in to an on-site workstation -- a perk which none of the other contractors received.
Code Freeze
When Darrell returned home, he got right to work. He spent a few hours familiarizing himself with the app he'd be maintaining -- a custom-built system that tracked inventory, scheduling and members for several libraries in the area. After paging through a few files, he knew he had to make changes to several core modules.
He returned to the office the same day to berate the other developers for their unacceptably lousy code. "I'll fix this awful code, but then I need you all to follow my standards," he told them.
Darrell took it up with management, who immediately enacted a code freeze -- for everyone except Darrell. That'd give him the opportunity to fix all of the modules that no one had even realized were broken.
So for three days, Darrell coded furiously while the rest of the staff watched YouTube videos and honed their solitaire skills. On a Friday afternoon, he showed up to the office in his characteristic suit and sunglasses, announcing to the staff that he'd finished.
"You guys use your weekend to examine all the changes I made. This is the way experts code! I want all future code to look like mine."
Breaking Changes
Job, a longtime developer at the company, had been wondering the whole time what was so bad about the old code. He was eager to see Darrell's updates. Breaking out his trusty diff tool, Job found that the only changes were tests for equality.
The old code looked like this:
if (customer = = null)
{
throw CustomerNotFoundExcepetion();
}
And the new code was:
if (customer.Equals(null))
{
throw CustomerNotFoundExcepetion();
}
The irony being that System.Object's .Equals() is an instance method, and would throw a NullReferenceException if "customer" was, in fact, null. Darrell's changes did nothing but break existing functionality and cause the wrong exception to be thrown.
Rogue Trader
Darrell made other so-called improvements to the code. His next change was to re-tab every file in the solution with a code-formatting utility. The merge tool struggled with all of the whitespace changes, so it was up to the rest of the team to merge the changes: change by change, line by line, file by file.
In an eight-day programming blitz, Darrell checked dozens of files out of the main branch in their source control, and was apparently so busy improving the code that he never got a chance to check them back in. Other developers on the team were getting miffed, because they needed to edit the modules and had no way to access them. Worse still, Darrell had vanished -- he wasn't answering his phone or responding to e-mail. The team was skeptical that he was doing anything.
Complaints eventually bubbled up to management, who summoned Job to join in a conference call with Darrell. And finally, Darrell answered the phone.
"Darrell, we've been noticing some delays in your check-ins," Job's supervisor began.
"Delays? What delays?! Everything's done!" exclaimed Darrell. "I've even done next month's work for no extra charge. It's just a lousy connection on your end -- you really need to update your connection. Right now I can't connect or even ping it!"
"Why didn't you let us know about this sooner? I'll restart it now."
"No, don't touch it!" It was too late, though. Job and his supervisor were sitting near Darrell's on-site computer, so Job had reached over to turn the monitor on.
To their surprise, it was in the middle of downloading a torrent. And the cursor was moving.
Tell Us Your Tale
Each issue Alex Papadimoulis, publisher of the popular Web site The Daily WTF, recounts first-person tales of software development gone terribly wrong. Have you experienced the darker side of development? We want to publish your story. Send us your 300- to 600-word tale -- if we print it, you'll win $100 and an RDN T-shirt! E-mail your story to Senior Editor Kathleen Richards at [email protected] and use "DevDisasters" as the subject line. |
While Job watched Darrell's session, Darrell kept complaining: "I can't believe you have such old network equipment. I've been trying to connect for hours! Why haven't you bought newer network equipment?"
Darrell opened up an IE window and went to eTrade. He sold a few shares of one of his stocks.
"We haven't been able to get the budget approved," said Job's supervisor. "But maybe you'd be willing to help with the $7,000 in stock you just sold on eTrade."
"..."
Darrell's contract was cancelled that day, and management began requiring more rigorous technical assessments as part of the interview process.
About the Author
Alex Papadimoulis lives in Berea, Ohio. The principal member of Inedo, LLC, he uses his 10 years of IT experience to bring custom software solutions to small- and mid-sized businesses and to help other software development organizations utilize best practices in their products. On the Internet, Alex can usually be found answering questions in various newsgroups and posting some rather interesting real-life examples of how not to program on his Web site TheDailyWTF.com. You can contact Alex directly via email at [email protected].,