Why Chris Hansen should be doing code reviews for your company

Another breathtaking excerpt from Thomas LaRock’s “DBA Survivor: Become a Rockstar DBA”.

Good code reviews are a necessary evil. They should be performed at regular intervals, perhaps at a project milestone or tollgate. Code reviews are a time for you to explain to your peers your thought process, as well as receive feedback on your code and design. The end result is better code, which results in a stabler system, which results in fewer production support issues. So why are most companies not bothering to do code reviews? Because everyone dreads code reviews.

Most people are not good at presenting. To make things worse, they know they are not good and that makes them even worse. Some people could be good, but get nervous when talking in front of a group of their peers. And those that are having their code reviewed feel as if they are being interrogated by Chris Hansen from “To Catch a Predator.” It all adds up to some of the most dreadful assemblies of employees you could ever hope to imagine. So we know code reviews are important, right? And we know that everyone dreads them, and as a result no one does them anymore, right? Now, I want you to imagine that Chris Hansen is leading the code review and you are the developer currently making your presentation.

CH: Do you know how old DTS is? What were you thinking? And you were not going to batch your transactions? Do you know what that will do to your log file?

You: I swear man, it was just talk, that’s all it was. I wasn’t going to do anything. I came here to tell my DBA that we needed to go our separate ways.

CH: Just talk? It’s a lot of talk. I’ve got the transcript right here. You say here, “I want to cursor through all your rows.” Man, that’s just wrong.

You: I know, I know. I’m getting help. The other day I bought a book on SQL Server 2008. And I am willing to do whatever I can to help you guys. Just tell me what you want me to do.

CH: Help us?

You: Yeah, with whatever.

CH: There’s the door. Go tell your friends we’re watching. And the next time they hand us deployment instructions that are more complicated than a NASA launch sequence, we’re coming after them.