Finding time to review code

Finding time to review code

« We don’t have time for reviewing code » is both the most often and most reasonable excuse anyone may have. Think about it, features are already late : they are not being coded as you read this post. Then, when it’s done, there will be the other features that are stacking up while the current features are piling up. Thanks for the next sprint, it will be kept to a reasonable level for the next two weeks.

And of course, all the dependencies are also running their own races. The framework is two versions behind the current stable one, and the framework 2.0, with major incompatibilities are being trumpeted for a year or two. The other libraries have changed and if we don’t know what changes, there surely is something brewing there…

Finding time to check code

Here are a few solutions for making your code reviewing valuable and worth something.

  • Make it limited-time aka time boxing : time boxing is a time management technic where a limited amount of time is reserved for a task whose length is unknown. Choose a good duration, something between 30 minutes to 90 minutes. Such amount of time should be easy to fit somewhere in the schedule, and you may also book it in advance, just like a meeting. Then, use it wisely to tackle a few left todos or fixes you have concerning your code. Not finished in time ? Bah, just drop it.
  • Do it during low activity time : there are always those moment in the week where activity is lower than usual. When the next meeting is delayed for no reason, this usually leads to a solid 15 minutes waste. This may also be because you arrived early at work (traffic jams may be lighter than usual) or on the eve of a holiday. Don’t skip the party in the next office for reviewing, but don’t let those moment pass by.
  • Use review to boost your concentration : whenever I have to start a new big feature, or something that will obviously take a lot of time to accomplish, I like to warm up my coding brain by doing some code review. This is always good to give something to seed to my imagination or my courage, and bring the usual know-how to my attention. After removing a few easy fixes, I’m hot for a larger chunk of conception.
  • Use it as a pause in your current task : this is actually strange to relax from coding or meetings by doing code review. The brain acts has a muscle : if you keep doing the same kind of tasks, it will grow tired. So, it is now time to move the problem around. You may consider code review just like cleaning your desk : this is work, right, but low intensity, and it has the direct reward of feeling clean. It will distract you from the current task, will help the code, and will provide some good relaxing for parts of your brain.

You may use a number of automated tools to help you in your reviews: they will do a lot of work in the background, and provide lists of code smells to check in the code. This way, it is a good starting point to dive into the code to an ‘interesting’ line of code. It also gives you really small tasks that can be used within the coding task, and not as a separate task.