The Gonvert
by in CodeSOD on 2012-03-28"We hired a Gontractor a few years ago," wrote Mike A, "this is some of his Gode."
"So far as I can tell, Goverting is the Pepper, MD of Converting"
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.
"We hired a Gontractor a few years ago," wrote Mike A, "this is some of his Gode."
"So far as I can tell, Goverting is the Pepper, MD of Converting"
"I recently took a job at a small interactive marketing company," writes Jason, "and, I'm sure like most small firms that hire programmers with little to no experience, the company is constantly putting out fires it started years before. One particular fire came from a client whose website just stopped working all of a sudden."
"It was a server outage or a date-based timebug, but more a message like this:
"When you move to a new town," writes Maynard via the Submit-to-WTF Visual Studio Add-In, "you need to take jobs at less-than reputable firms to get yourself settled in. "
"I cleaned up a lot of filthy code during my time at $company_name, but I couldn't bring myself to alter a single line of this monstrosity of a method. I think my favorite part is when the 'password' and "confirm' are each checked against a regex, and only then does it check if they are the same string."
"We came across this trying to sort out why the application never threw errors which said what the problem was," Tom writes, "I wouldn't have minded (much) but the random number generator was something to behold."
When Jeff saw a line like this one, he knew there was something terribly wrong in the code he had inherited.
eval(Application("buildCommon").toString());
He wasn't sure what was more troubling- the way the Application
variable was being used, or the fact that C#, as a compiled language, doesn't have an eval
statement.
"We have a bit of a dead code problem," writes R.S., "most of the time, it's different versions (sometimes older, sometimes newer) of the same class that were created as part of a good-intentioned refactoring that was never quite completed."
"And then we have mysterious classes like these."
"I'm involved in a big project to re-implement an old, Classic ASP application in a more modern language," writes Mike Johnson, "although I have a decent amount of Classic ASP experience, I still struggle at times interpreting the old. It is a big mess."
"A previous employee, Dan, was famous for churning out tons of code. Users loved him because he seemed responsive and always fixed their (numerous) problems quickly. Sadly he never stopped to really understand what he was doing. When faced with a new problem, he just wrote more code.