Article 44BJF CodeSOD: Golf Buddies

CodeSOD: Golf Buddies

by
Remy Porter
from The Daily WTF on (#44BJF)

Hiring people you know is a double-edged sword. You already have an established relationship, and shared background, and an understanding of how they think and act. You're helping a friend out, which always feels good. Then again, good friends don't always make good co-workers, and if you limit your hiring pool to "people I know" you're not always going to find the best people.

Becky's boss, Chaz, tends to favor his golf buddies. One of those golf buddies got hired, developed for a few months, then just gradually ghosted on the job. They never quite quit or got fired, they just started coming in less and less until they stopped coming in at all.

Chaz passed the code over to Becky to fix. By "passed", that is to say, he emailed her a zip file of the source, which was the only working copy of the code. There was no documentation, no source control, certainly no tests, and no description of what the program was actually supposed to do. "Just fix the bugs," Chaz said.

M m = new M(true, C);Mc mc = new Mc();mc.AccountReference = Mb.AccountReference;mc.Originator = Mb.ShortCode;IEnumerable<msgItem> e = from x in mgroup x by x.To into yselect y.First();string r = string.Join(",", from x in e select x.To);Msg msg = new Msg();msg.Body = Mb.Text;msg.Type = MessageType.SMS;msg.Recipients = r;mc.Items.Add(msg);res = ms.Send(mc);Mb.LocalStatus = LocalStatus.Sent;Update(Mb.BatchID);if (res.Ids.Count != e.Count()){Mb.LocalStatus = LocalStatus.Failed;}

Obviously, this "golf buddy" was also a bit of a fan of keyboard golf. I mean, look at this line. Look at this.

M m = new M(true, C);

I could just stare at that line all day. Every developer tends to use a little bit of shorthand, but this whole block is amazing in its opacity. I'm convinced that the fact the class Mc has fields named AccountReference is a sign that there was at least one other developer on this project, who was trying desperately to use words.

They obviously LocalStatus.Failed in that.

proget-icon.png [Advertisement] ProGet can centralize your organization's software applications and components to provide uniform access to developers and servers. Check it out! TheDailyWtf?d=yIl2AUoC8zAzztkl2AXNvM
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments