views:

93

answers:

3

It seems that most code reviews are bottom to top - being that the lower engineers get their code reviewed by the higher ups and the higher ups by the managers or not at all.

It occurred to me when working with some new graduates that a top down code review may be a great thing. The idea being that us older guys have probably adopted some bad habits along the way that are no longer going noticed - something the newer guys can pick up on being fresh on best practices.

In addition I think this could lead to a sharing of ideas among developers at every level that will lead to better coding all around. Older guys sharing experience while newer ones sharing latest education.

Anyone have experience with this?

+4  A: 

I tend to go with peer-based code reviews where everyone can look at the code together on a projector once a week and comment, ask questions, make suggestions.

We realize we can't get full coverage but we hit the hot spots and the benefits usually get applied by the team in the other areas we are working on.

We also routinely email each other code snippets we have questions on, either that we are doing, or that we find left from the previous iterations. Anyone can grab a couple of people in the room and sit down and go over code together as its being refactored/rewritten.

blu
+3  A: 

I think a lot of this depends on the development team involved and the quality of the "new" team members. I would say that in my experience being an instructor at a college and working with many graduates. Not many of these "new graduates" are really going to be up on "best practices". However, there is the odd occasion where you are going to find the guy that really goes above and beyond.

However, aside from that, a top-down code review as you mention is a GREAT learning opportunity for the new developer and can be a nice teaching/learning opportunity for the high-level developer.

Lastly, I'll stress that the "older guys" should do what they can to keep up on the best practices. In 99.9% of the cases the new to the field people are going to be learning from you, and setting a good example is something important. At least to myself, and the team members that I work with knowing best practices, and doing things the "right way", at least as much as possible is an integral part of our day to day activities.

Mitchel Sellers
+1 for code reviews as a learning opportunity.
Sam
There is something to be said for the younger people having fresher perspective but I would agree - 90+% of the time the more senior engineer is the one bringing the suggestions to the table
Fraser Graham
+1  A: 

In my experience you get different benefits from having your code reviewed by a peer, a less senior engineer or a more senior engineer...

  • A peer provides constructive criticism, feedback and also becomes another resource for understanding what you are doing and how to maintain it in the future.

  • A senior engineer can often better analyze how your work fits into the bigger picture and provide guidance in the form of years of experience.

  • A Junior engineer gets more benefit from the review than you do, in some cases they will bring fresh perspective but in my experience most of the benefit comes from you teaching them about your code, explaining why it was done a certain way and attempting to help them get to a point where they might be comfortable maintaining it in the future.

To get the most benefit our of code reviews for your entire organization you should consider having your work reviewed by more than one person, pulling from each of these groups. That way you get a more diverse set of feedback and as an added bonus more people know your code and can maintain it in the future.

Fraser Graham