Code Reviews - Not just a quality tool

Code Reviews - Not just a quality tool

I’m a big fan of Code Reviews, or Peer Reviews, within the work flow of a team. But many times when talking about them people refer to them mostly as a tool to avoid bugs, improve quality or the overlooking of details. While these things do surely come out of having a review process, I do not believe they are the real reason why they are a good thing for teams.

Code Reviews, to me, are about getting the team in sync. They are about making sure the team’s core values are spread throughout the team and observed. I’m not talking about Coding Standards, those can be enforced and checked with automated tools, I’m more concerned about architecture, code simplicity and conventions, things that are not measurable to some extent and more about making sure code reflects the core values you have.

In my previous team I made sure to on-board every developer by having them read up on Object Calisthenics , a practice that helps code awareness and promotes simplicity. This practice cannot be enforced by automated testing like coding standards, and this is where I believe Code Reviews have a role to play. While having your code reviewed and then reviewing other people’s code, you are exposed more and more to these aspects, and both of those parts are equally important.

During our on-boarding process the first thing developers are exposed to is reviews by the team lead. In our case we were expanding from a one man team, so the team lead held the core values, what we believed good code should look like. The first few weeks were about expressing this and showing, by example, to the team. This is where you can show what your thinking would be to solve these problems in alternate ways. For this step its very important that both sides keep an open mind, because at this point you are building the new core values, which the team will believe in, this means no one is right.

Now, only having your code reviewed and criticized is not a learning experience, the real learning happens when you start reviewing other people’s code. This is where you have to start internalizing the agreed values and projecting them on other people’s code. In our process I noticed that some developers were focused on large tasks and some on short tasks, the ones on longer tasks took more time to integrate into this, due to the long feedback loop. I recommend you try to make sure new developers have a balance of short/long tasks so they are not out of the feedback loop.

After a few months of our team expansion we noticed that the comments made on each other’s code were a lot more standardized, especially to me, the team lead. I noticed that by the time I came in to make a comment, another team member had already made it. This was a good sign that the core values were being spread.

One thing to note is that when a big change happens in the team, here we went from 2 devs to 5, it is important to re-build core values together, not simply impose them. We had many team meetings to discuss code together in order to evaluate if our values were indeed useful and made sense. The practice of “code burns” is great for this. Code Burns are nothing more then team code reviews where you can make comments and discuss as a team about each point.

If you are trying to implement a Code Review process or if one is being implemented in your team, be sure to keep this in mind, its not about having your code criticized by someone else, its about helping everyone be on the same page about what the team believes is good code.

Looking for someone to do this in your company? I’m currently looking for new challenges

comments powered by Disqus

Related Posts

Desenvolvendo um auto-complete com PHP e Ajax

Desenvolvendo um auto-complete com PHP e Ajax

  • July 10, 2006

** Script atualizado para versão 1.1, clique aqui para ver os detalhes **

Desenvolvendo uma solução de sistema de gerência para o Dep. Comercial do ComuniWeb recebi inúmeros pedidos de “mas não pode aparecer os nomes dos clientes quando vou digitando?”. Ok não foi tão lindo e poético assim, na verdade o que acontecia era que o auto-complete padrão do IE causava uma confusão enorme nos usuários (usuário é usuário né?).

Me vi então cara a cara com um problema, como resolver este problema? Precisava que um script ao tempo que a pessoa digitava fizesse uma busca no banco para retornar a lista de clientes e o seu vendedor, isso tudo num browser. Se o tmepo hoje fosse alguns meses atrás (não muitos) eu falaria “impossível, estamos falando de web, nao delphi ou VB!”. Alás que surgiu o xmlHttpRequest e tudo mudou…

Read More
Como a Microsoft esta facilitando o desenvolvimento com PHP

Como a Microsoft esta facilitando o desenvolvimento com PHP

  • January 6, 2011

Recentemente tive a oportunidade de conversar bastante com a Microsoft, junto com outros membros da comunidade PHP.

Read More
On the blogging road...

On the blogging road...

  • July 8, 2006

Saudações visitantes, Por algum tempo pensei em entrar para este mundo “blogger”, mas não o blog pessoal de relatos pessoais sobre eventos diários, não faço coisas novas e diferentes o bastante para contar ao “meu querido diário”, então essa idéia nunca teria chances.

Read More