
Most books on project management and team leadership have a chapter or so on Constructive Criticism. There are even entire books on the subject. Oh, and an acronym for how to do it correctly for the cornflower blue tie wearing corporate douche bags.
The idea is that if someone criticizes another person's behavior the wrong way it may be perceived to be a personal attack on them. A developer is much more likely to be accept casual suggestions and quiet leading questions than if your comments are emailed to everyone in the office. If a developer does something the wrong way, quietly show them how to correct it and do it better in the future without hurting their ego.
At work we've decided to take another approach. We call it The Wall of Fail.
Every time we come across a co-workers code that makes us think "WTF was this guy thinking?", "Was he on drugs?", or "How did he ever even get this job?" we print it out, highlight the truly horrific sections, and put it on the wall for the world to see. Then we openly point and laugh.
It may seem a little harsh, but no one gets upset about it when their code is posted. We're a small company of people who realize we all make really dumb moves once and a while. Everyone gets their turn being thrown under the bus. The good news is that once we're openly mocked for our bad code, the chance of us repeating the same mistake again is pretty slim. If someone else was doing the same thing but hasn't been caught just yet, now they know too. Plus, most of it is filled with code from old projects initially created by developers who have moved on and we're just doing maintenance or updates.
Here's a few examples:
$success = true;
} else {
$success = true;
}
$dateDiff = ($currentTime - (3 * 86400));
} elseif $dateDiffAmount == 'twoDays') {
$dateDiff = ($currentTime - (2 * 86400));
} elseif $dateDiffAmount == 'fiveDays') {
$dateDiff = ($currentTime - (5 * 86400));
} elseif $dateDiffAmount == 'tenDays') {
$dateDiff = ($currentTime - (10 * 86400));
} else {
$dateDiff = $currentTime - (86400);
}
Also check out:

I'm Dan Previte, a web developer and a geek in general living in Chicago and working for




Contractors are often to blame too.
I’m not sure what boils my blood more; the fact that they get paid 5 times as much as me, or that they shit in a box, gift wrap it and then call it a flash game.
Steve
March 20th, 2008
The Wall of Fail…
[...]Most companies and project managers suggest constructive criticism when working with developers. We take a slightly different approach.[...]…
Web 2.0 Announcer
March 20th, 2008
I totally agree with Steve’s comment. There are contractors you’d just like to kill for their “performance” - but then there are contractors, you really need to get your project done.
I like those contractors much more, that shut up done there work and form time to time show us, why they are worth there money (have nearly bug free code, reducing development time, helping others on the team becoming better, …)
I think the “wall of fail” would be a nice tool (thinking of a hammer (tool) here), to get rid of the useless contractors in a nice and efficient way. (Or are we supposed to pay them, so that they learn how to code right at our site?)
Rene
April 20th, 2008