Do you do “Code Review”?
After working for small start-ups most of my career, I find myself now working for a larger public company. Rather than being the Jack of All Trades on a project I am but one developer in a team. One practice that I have come to really appreciate while being part of this team is Code Reviews, and I think they have a real place in every developers life, weather you are a lone developer or part of a team.
A code Review is a time when developers meet up to review each others code, the key here is to remember that it is not necessarily to look for bugs but to share ideas and thought on coding practices and strategies. I was quite taken back the first time I got a meeting request for a code review, I was annoyed (to say the least) about the thought of someone else critiquing my code. But by the end of that first code review I had changed my mind completely on the idea of Code Reviews, and I think it is something that can really benefit everyone who does anything from HTML and CSS to back end programming weather it be C, Ruby, Python or PHP.
Code reviews can get developers involved in different aspects of development than they’re used to. Team members may be so heads down with one part of the application that they overlook a simple solution that is obvious to someone not as involved. Sometimes, two team members working on similar modules discover that they can share more code than they previously thought. This helps reduce redundancy and keeps the team educated about what everyone is doing.
Other benefits to code reviews are encouraging consistent coding standards and to help ensure that everyone is on the same page. Coding standards may not seem that important, but cleaner code makes it easier for someone else to come in and start working with it which is great in Open Source Projects. Additionally, coding standards can help prevent common logic errors or other simple mistakes.
These later points really come in to play for individual Developers, but the single biggest benefit of code reviews is the opportunity for education. Senior developers can pass their wisdom and insight to junior developers. Juniors can offer senior coders unbiased and fresh ideas overlooked by someone more set in their ways.
To prepare for the Code Review you send out your code to all other participants at least 24 hours before the Code Review to give them time to look it over and make notes. Print outs of the Code will really help, just make sure you print it with line numbers so everyone can stay on the same page (err, line number :-)) Always remember that you are reviewing the code not the Developer, you have to show respect for the Developer even if you do not agree with something he may have coded.