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.
« Jul 08

August 2008

Sep 08 »
"I have been helping a guy with a project," seebs wrote, "I wasn't originally involved, but when the three-month project was six-months late, I got called in to start on the other half. I still remember the sick feeling in the pit of my stomach when the developer told me "all fields are varchar for simplicity...'"

SUSBSTITUTE_CODE

2008-08-25
"Not too long after starting at my new job," Franc wrote, "I came across a rather unique way of noting what code needed to be fixed."

pider Detection

2008-08-18
"I came across this snippet in our header file," wrote David, "it's a basic webspider detector that is used later on to record certain actions differently if $is_spider was set to 1."

Are You Sure?

2008-08-13
"There was a minor bug in one of my company's applications," Craig M wrote, "for whatever reason, it just hung after the 'Are you sure?' prompt."
As we learned in Random Stupidity, developers don't really trust rand(), random(), Random.GetNext(), etc. Nor should they. The documentation, after all, clearly states that the function "generates a pseudo-random number." That's right, pseudo. Who wants pseudo?

Please Think Twice

2008-08-04
"While reviewing some of our older code," Rob Jacobs wrote, "I stumbled upon this."
« Jul 08

August 2008

Sep 08 »