Code Reviews

Written by Manas Jul 06


Code Review Cartoon

Code Review Cartoon

For those who don’t know, code reviews, as the name suggests, is going over the code you have written before you incorporate it into your product. Oh - I should have mentioned - you don’t review your own code - you get someone to review it for you. The primary purpose is to find bugs.

Though many folks look at code reviews as just another process overhead (we all write perfect code, don’t we ;), I find code reviews very intellectually satisfying.

So, when someone reviews your code, you roughly follow the following steps:

1. Ask someone to review your code
2. Get review comments
3. If no comments, either you wrote great code, or (greater chances) the reviewer did not review it very thoroughly. Consider going to step 1. If really sure, Goto step 6.
4. Discuss comments, make changes as necessary
5. Goto step 1.
6. Done!

If you are a new developer, or writing a big chunk of code, chances are that you’ll loop through this multiple times before your reviewer is completely satisfied.

As a new developer, at times people tend to take review comments personally - it’s natural. It is important to understand that code review comments are to be taken personally only if you get the same comment more than once. Code review comments are one of the best ways you can refine your coding skills. If you admire someone’s coding skills, ask them to review your code. Don’t be overly defensive - as I mentioned before - code review comments are not personal. Learn from them - and be a better developer! If you’re lucky, your reviewer will also look at the class structure instead of just the individual statements. You’ll improve upon you design skills too. And of course, you’ll introduce fewer bugs into your product.

On the other side, doing code reviews for someone is also an enriching exercise. Things when performing a code review -

1. Find bugs. Make it a fun exercise. You’ll find a bug if you look hard enough. It just has to be there :)
2. Learn from the patterns your fellow developers are using - especially true when reviewing code of experienced developers.
3. Understand components that you don’t work with on a day to day basis.

Personally, I find code reviews fun and exciting. And luckily, I have a great set of folks who do great code reviews, and give out great code to review.

Hope you enjoy it like I do!

Random Stuff

Written by Manas Mar 19

People have been asking me why have I suddenly disappeared from the blogging circle entirely. I actually have - my last post was something like 2 weeks back!

I’m quite busy in office these days, and have taken up a new schedule where I get up by 6.30 in the morning and am in office by 8.30 :) Which also implies no staying up till crazy hours in the night. I am working on an exciting new project, and am learning a lot. I’ll write a post on work culture in my company and the kind of work I do soon. 

I took up the Art of Living course last week, and it was simply amazing. The best part was that it was not as if they were forcing you to accept some particular belief or ‘Guru’. The yoga was great, and I feel so much better now. I would urge you to take this course up whenever you can - after you do it you’ll realize that you should have done it a long time ago, just like I did!

I went on a company picnic to coorg, and had a great time. The resort we stayed in was just awesome. I got to stay in a private villa that had a private pool (all for myself :), jacuzzi and lots of other stuff. Won’t say that coorg was amazing, but out resort (Orange county) definitely was. In addition, these picnics help one be better friends with people in your team :) However, the resort was expensive (I’m not even sure if just ‘expensive’ describes how expensive it was), so no point going there on your own. Wait till your company takes you there! 

My post, a must have internet explorer add-on is getting a LOT of spam comments - I get upto 10 everyday :( Guess I’ll just disable the comments for that particular post.

This is all that is going on in my life - well almost :) What about you?