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

April 2012

May 12 »

Self Documenting

2012-04-30
"A little while back, someone introduced the concept of 'self-documenting' code to our team," writes Ryan L. "It was certainly a step forward, but it's somehow taken us two steps backwards. Consider, for example, the following code from an MVC controller."
"When the job ad specified that an 'enterprise' Senior Java Developer was needed, I knew I'd be in a treat for some enterprisey goodness," writes Chris B, "but what I didn't expect was the User Agent Detection Generation Framework. Here's what the API for this framework looks like."
"As part of my new role for a software development firm," writes David Mayer, "I was assigned to sift through some code looking for bugs in the dictionary and spellchecking system. That's how I came across a function called get_words_from_a_number_which_is_passed_as_a_perimeter_into_this_function."
"Working through a pretty ugly project, I came across this C# beauty," Matt B writes, "at first, I was unsure of what it did. I was utterly perplexed until I took a second look at the function name. "
"I was recently assigned to work on a project that had been abandoned by its developer," wrote George Z. "After I checked-out the code for the first time, I started sifting through hundreds of lines of bad syntax, and bad practices."

Roman Enumeration

2012-04-02
"At my company, the powers-that-be determined that, because we rejected a lot of job candidates, my group was ineffective at hiring new employees,"Kendall writes, "thus, the responsibility of hiring new developers was shifted to a group much more proficient at hiring: human resources."
« Mar 12

April 2012

May 12 »