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.
« Dec 09

January 2010

Feb 10 »

Break Out

2010-01-27
“I’m continually amazed by the unique and clever solutions developed by my colleagues,” Mark writes. “And I should say, I don’t mean ‘amazed’ in a good, innovative-idea-to-save-company-money sort of way. It’s more a wow, that’s more wrong than I could have ever imagined sort of way.”
"One of our desktop applications has a progress bar in it," Bryce N. writes, "and as I was working more and more with the code, I noticed that the progress bar would progress to a seemingly random part in the bar, but never past the halfway mark. This would probably be ignored, if it weren't for the fact that I noticed that my breakpoints would only be hit when the bar reached the 'random' mark."

Piecemeal SQL

2010-01-18
I can see it now.  Everybody will say how the following bit of Java code that Shawn C. has sent in isn't actually a WTF and is, in fact, quite brilliant.

Helpful SQL Helpers

2010-01-13
"I recently had the chance to work on one of our projects that has been in development for longer than I have been employed here," writes Phillip, "back when the project was first started, a large part of it was outsourced overseas because, well, that was all the rage back then."

Insert Comma?

2010-01-06
"While browsing the code base of a recently inherited project," Joey L writes, "I found this curious method."

The Integer Cache

2010-01-04
A few months ago, Hugh accepted a contract assignment to work on a Java project and, ever since starting, his day-to-day has felt a bit like the old game of Zork: a maze of twisty passages, all alike. So far as he can tell, a large part of the system was created by a chimpanzee (possibly orangutan) that received a treat whenever it pressed a giant button marked "Copy and Paste". One of the class files that Hugh has spent a bit of time working on has over 10,000 lines of code and at least one method that's over 2,500 lines long.
« Dec 09

January 2010

Feb 10 »