The app was a complete mess. From lengthy SQL queries that slowed to a snails pace when the app grew to handle 10,000 rows, a particularly embarrassing 100 line long if else statement (not kidding) and a UI which looked like it might have belonged to the late 1990’s. Still, it was finished! And to me, at the time, working meant finished.
I should also mention our team was not using test driven development while making this app. We relied on a one-man (at the time) QA Engineer to test all our apps. With little oversight and no real way to test the many edge cases that the app presented, it was shipped and it kinda worked for a couple weeks.
It’s amazing, in retrospect, that no one caught this bug. We had the habit of using the same items for testing and in this case, those items worked perfectly. It took around 300 stores, using this app apparently around the clock to return meat, popsicles and Hawaiian shirts. Around 10,000 requests later, all that rounding had cost our company around 5k.
I was sure I’d be fired. Fuck, just a few months in to my first software job and I’d wrecked the company. I waited for the team to kick me out, their disapproving fingers wagging back and forth after I walked out the door with my items in a sad cardboard box.
That day never came, thank Bob. I fucked up. We came together as a team and fixed that app and I learned a $5000 lesson. Our company was making around 2Bil a year, so that amount didn’t exactly tip the scale. Still, it taught me a lot about getting the requirements for an app before you code, understanding the code you end up writing and most importantly, test that shit.
That wasn’t my first or last mistake involving writing bad code but I pray it’s my most expensive.