What is in a Review?

We did a static code review on the throttling Carbon component today. There were many code improvements suggested. And I am sure there were many things that the new guys who recently joined WSO2 learnt.

What was more interesting was the final outcome. We found that:

  • Each component need a built in mechanism to handle user documentation
  • That we need to review the WS-Policy designs that we have used for components
  • And that a training on WS-Policy for all the folks would be ideal

Now all there ideas were generated, because we questioned a logical block in the code that was being reviewed, that did not seemed right. If not for the code review, we would not have got together and realized that these problems are there.

I am happy that WSO2 engineering practices are paying off, and that we are continuously questioning our own design decisions and continuously keep on improving our products.

I remember, few weeks back, we reviewed some ESB related code. The code was of very good quality, good level of comments and nice coding convention adherence. Even that code lead to some constructive discussions, like, on how best to log and what to log.

So at WSO2, code reviews have helped us to:

  • Learn form others
  • Share the knowledge with others and teach the good things that one knows
  • Pause for a while and get together to get to know what other people are working on
  • Re-visit design decisions, which would otherwise be hidden in the pile of mails in the dev mailing lists
  • Re-think about the way that we write code and improve ourselves over time

 

It is true that we are working on open source projects, both in Apache and at WSO2. However, we hardly look at other people's code. The apache way of "commit then review" sounds cool, but most of the time, the "commit" part happens, and "then review" get practiced occasionally. While code review meetings do not address this problem completely, it helps us to live with it, because the education that people get out of reviews would help them write better quality code.

The idea is to get everyone to write good quality code, rather than let them write crappy code and then fix it later.

Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime. - Chinese Proverb

Comments