Yesterday we had a very good session of code review on a project we are working on (developing a solution that updates Active Directory when the user updates his user profile) so I figured it wouldn't hurt to share how we did it.
Code review, if done right, is a great process to raise the quality of the code and therefore the end result of what you are developing.
So, how did we do the code review? We sat in a room, all developers, and opened VS on the projector. After a short explanation of what the code is trying to achieve, we just walked through the code. We let the most junior developer read the code to us and explain what it does (don't just read out the lines - make sure he translates the code into pseudo code - for example: "we loop over the user profile's properties and put them in a string array"). During this, everyone of us was in charge of looking for way to improve the code:
- Naming conventions
- Coding standards
- Optimising performance
- Error handling
- Keep the atmosphere light and not overly criticising - we are here to get better.
- Make people who didn't write the code read out and explain the code.
- Involve everyone in decisions on how to optimize the code.
- Go through the code in a logical order - start from the things that the user sees, and walk through the code to the backend code.