Measure Twice, Cut Once: Your Website Needs a Code Review

Submitted by Daniel Henry on 01/23/2014 - 09:52:am

You just received a brand new website, and before you finalize the handoff, you are putting on the final touches and polishing out the kinks. The website works seamlessly, until one day you have a project to make a few changes and additions. You think it will take less time because your website is so much better than before. Upon further inspection, you find out that there is more worked involved even though you are using the same development team.

When you first build a website, it is important to budget time in for code reviews. There are many reasons for this that we will cover in this post, but it is important to know that it saves time and money when a development team revisits a website for changes.

What is a Code Review?

A code review is a fancy term for having a second set of eyes look over every piece of code written for a website. It ensures obvious errors are avoided, and best practices are in place. When writing code, developers should put in a couple lines of description for each line of code to describe the functionality, so other developers can follow and easily make changes.

In the future, the same team (or a different one if you are looking to start over) can look at it and understand what the developer was thinking when building this code.

What It Fixes

  1. Security Holes. Certain bugs, like syntax errors, are caught when a program is compiled. Other errors are not found and can cost you thousands or even millions of dollars. These errors are found by a code review.
  2. Page Load Times. There are a number of ways to write code so that it functions. There are better ways to right it to make it efficient. Following best practices and having a second set of eyes ensures the code is written as succinctly as possible. When the website is running, less code means the page loads faster, and customers will likely to spend more money.
  3. Spaghetti Code. As stated before, code can be written a number of ways and still function. That is until a module breaks and it takes the rest of the modules down with it. When this happens, it means that the code is connected where it should not be. Modules are so named because they are modular and, therefore, separate from each other. Connected modules means code was not written correctly. It can happen easily without the right expertise, but a second set of eyes will catch this and fix it.

What You Gain

  1. Performance. A site written with efficient code and adequate comments runs faster and is less prone to breaking. Downtime is minimized greatly, so your business can increase uptime and revenue.
  2. Longevity. Without spaghetti code and excess code, your site will last longer than a site without a review. There will be less downtime needed for bug fixes because things won't break along the way and you can worry less about operating online.
  3. Future Changes. Because the code was written efficiently and documented well, any changes or additions will meld easily into the site. Developers won't have to spend hours figuring out the reasons for certain pieces of code because comments will explain it thoroughly. New changes can be underway and accomplished in less time for less money.
  4. Your Bottom Line. By spending the time and money to make sure the code is at its best for your investment, you will get a higher return since your website will provide a smoother way for people to spend money with you. A broken site doesn't encourage spending, but a consistently fast site spreads and makes more money.

Summary

While a code review is only a small portion of an overall web development project, it  ensures everything is secure to work as intended. Simply having a second set of eyes to look over another developer's work will catch things that a computer program won't catch. A second look checks for efficient code design, security errors, and well-designed modules. If you budget for a code review when building a new website, your site will last longer, perform better and provide a higher return on investment.