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.
« Jan 12

February 2012

 

The Phony

2012-02-22
"My first impression of my predecessor was a positive one," writes Michal Ochman, "he was well-spoken, sharply dressed, and seemed to be an all-around nice guy."
After weeks, months, or even years of setting up and preparing to sell, it’s always exciting to get those few customers. Depending on the venture, it may not be worth popping open a bottle of Champagne, but no matter how small the sale, one can’t help but take a few moments to pause and smile before struggling to get that next batch of sales.

The Lemming Switch

2012-02-16
"The way in which project requirements meet developers at our company is a WTF in and of itself," writes Kevin, "but suffice it to say that a certain developer was tasked with writing a Windows Service that would periodically review a list of files from the network and purge them if necessary."

The Applet Redirect

2012-02-13
"One of our sites is partially maintained by a third-party vendor with developers based out of Kerbleckistan," writes Nathan, "they'll sometimes 'forget' to use version control and instead just write directly to production. This has naturally caused some frustrating 'lost feature' problems when they remember to use source control, and somehow this all falls on me to mitigate."

SQL MUGging

2012-02-08
"We're replacing an old PHP website," writes Roggo, "to examine the existing functionality and test the install, we were given access to the live site. Out of curiosity, I had a look at the code that we are soon to replace. The first file I opened was called mug_password_forgotten.php; I was greeted by line 8:"

Dirty Code

2012-02-06
Ever since being hired, Adam had spent most of his time working on new projects.
"Lucky me," writes Joe from the Submit-To-WTF Visual Studio Add-In, "I just inherited a home-grown system information application."
« Jan 12

February 2012