Friday, August 19, 2011

Code Reviewing - do you do it?

My personal experience is solely based on the Portuguese standard. We, as a nation, tend to be more relaxed about planning and procedures. Well, not all of us, and definitely not all of the companies also, but certainly a lot.

Portuguese rely and brag on their ability to quickly solve problems in real time, as they appear. It is something we call "desenrascar" and can not be easily translated to a word in English. It is what it is: find a quick (and very often suboptimal) solution for a problem.

But...aren't we talking about Code Reviewing? Of course. The introduction is just to say that it is very usual to make it work and then fix performance problems as they come along. Every project has unit testing, whether very explicitly well defined or not, throughout the development phase, but most will leave performance tests for later. And when you find problems in that phase, your work to correct them will certainly be hard.

What can you gain from Code Reviewing and how can you do it? If you have a nightly build or continuous integration process, you should integrate the basics there. Most of the times, you will find that there are already some tools to do what you need automatically (in SharePoint, the most basic piece will be the SPDisposeCheck). You should also include some performance metrics here. They can help your early and correct detection of problems.

In terms of architecture and best practices, you and your co-workers should always keep a thinking mind in place. Don't just code, think about what that code means and what it will do. Don't just implement. If you believe there is a better solution, talk it through with who made the system's architecture. It will help become a better and more complete developer. If you are an architect, you probably already know you should always try to improve your way of solving the problems and see how others nail it.

Where did this all came from? This great article in NBSP, My Top 10 sanity checks when performing SharePoint code review, by Stephane Eyskens. If you are into SharePoint, read it, even if you are aware of these issues. Always good to review and see different points of view

No comments:

Post a Comment