Recent 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.

15 Apr 2015

Tri-State Boolean

by Jane Bailey in CodeSOD on 2015-04-15

Five-leaf Clover, Megan McCarty128


101 Comments - Last Comment @ 18:06
13 Apr 2015

Descriptive Overload

by Maciej Stachowski in CodeSOD on 2015-04-13

Information Overload

Unquestionably, a good method name should be descriptive. With today's code completion and code analysis features, almost all developers expect the names to give them at least an idea of what a method should do. When you write a library, or work on a shared codebase, it's a must- and even if one doesn't expect anybody else to use their code, it's still good not to have to remember what stuff doStuff() does.

0 Comments - Last Comment @ 15:01
08 Apr 2015

Delete if Not Exists

by snoofle in CodeSOD on 2015-04-08

Early in life, we learn to grab the food and then put in in our mouths. Later, it's grab the ball and then roll it. In general, you must have something before you can attempt to do something with it.

...Or so you'd think.

42 Comments - Last Comment @ 2015-04-15
02 Apr 2015

Scheduling Buttumptions

by Jane Bailey in CodeSOD on 2015-04-02

Steph had been at this job long enough to be fairly good at it, but not quite long enough to have peeked in all the dark corners yet. As such, when she heard that there was an issue with scheduled jobs, her first thought was to poke through cron to see if she could pick out what schedule was misbehaving. Apparently, all of them- cron was empty.


Confused, she went to her team lead Greg, asking about where she might find the scheduling setup. And that was when she heard about Travie the Whiz Kid. A junior developer with no degree, he'd been hired solely based on his ability to talk a big game about how he single-handedly saved several companies by providing them with innovative websites during the dot-com bubble... when he was twelve. The Whiz Kid was a Special Snowflake; he preferred to reinvent the wheel rather than implement stable but "boring" code. Upper management was convinced he was an unparalleled genius, and had exempted him from the usual QA standards. Unfortunately, he'd grown utterly bored with Business Intelligence and transferred to the Web team, leaving his inventions behind for Steph to maintain.

59 Comments - Last Comment @ 2015-04-09