Recent CodeSOD

Code Snippet Of the Day (CodeSOD) features interesting and usually incorrect code snippets taken from actual production code in a commercial and/or open source software projects.

Aug 2009

Late Payment Math

by in CodeSOD on

"For three years, I've made my car payments on time and in full," Clark S. writes, "and the one time I'm a few days late — whooo boy — do they let me know. Phone calls at home, phone calls at work, letters, emails, you name it. As if that isn't bad enough, then there's the Late Payment Math."

 


Desperate Times

by in CodeSOD on

Desperate times call for desperate measures, and in the midst of the Great Recession there’s quite a lot of desperation going on. Hourly bill rates that once made lawyers blush have come crashing down to the point of “wow, my gardener charged more than that.” And while the whole idea of “being selective with projects” is still around, the bar for what’s accepted has dropped to any and all projects. It ain’t pretty out there, especially for folks on the front lines like Matt.

“Four years ago,” Matt writes, “my company swore that we’d never talk to Initrode Global again. It wasn’t just their massive VB6 application that they refused to even consider upgrading, it was more that they insisted on fixed-bid estimates and constantly low-balled our numbers. Oh, and halfway through a project, they’d insist that we throw in an out-of-scope feature for free, since they were a paying customer and all.”


A Confusing SELECTion

by in CodeSOD on

It was Anthony's second day on the job, and the sixth time he thought to himself, What The Fuuuuuhhhggggg, while searching through the code. At least, he thought that he kept that last sentiment to himself.

Not a moment later, his coworker asked "what is it?" and then scooted his chair over to see Anthony staring at the following code, mouth agape.


Self Modifying VBA

by in CodeSOD on

"I work as a support developer for the trading desk at a fairly large bank," Jay P.L. writes, "some of the automatic trading systems used have grown organically from what can originally be called an Excel spread-sheet. However, the complexity can sometimes be overwhelming."

Jay continues, "When traders find functionality that doesn’t quite work as expected, our usual response is, 'just send over the spreadsheet and we'll take a look at it.' Cracking open the VBA and debugging through the issue usually finds the cause relatively quickly. Most of the time, the issue can be blamed on a close colleague who made the mistake during a particularly hectic trading atmosphere under an abundant amount of stress and pressure. These situations are usually overlooked and forgiven. The issue fixed and returned."