Article VPNC CodeSOD: Mid-Stream Switch

CodeSOD: Mid-Stream Switch

by
Ellis Morning
from The Daily WTF on (#VPNC)

Submitter James writes: "I'm working on a project that has as one of its components a Microsoft App for Excel 2013. My team lead wrote most of the app up to this point, and I'm adding features. While exploring her code, I ran into this little gem (in JavaScript):"

function ClearData() { var spn = document.getElementById("spntest"); spn.innerHTML = ""; var def = $.Deferred(); var arBlankMiddle = new Array(); var arNull = new Array(); arNull.push(0); spn.innerHTML = ""; for (var i = 1; i 

James explains: "writeData() is a function that writes to Excel given the specified range and data. So it looks like she started with an iterative approach, but in the middle switched to a non-iterative one, but left the half-finished iterative code in. I'm speechless."

release50.png[Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped! TheDailyWtf?d=yIl2AUoC8zA8MQnxDGlCbo
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