Code Review – How to Review Code You Do Not Understand

code-reviewsteamwork

I have been given the role to improve development in our company. The first thing I wanted to start was code reviews since that has never been done here before.

There are 3 programmers in our company. I am a web programmer, my known languages are mainly PHP, ActionScript and JavaScript. The other 2 developers write internal applications in VB.net

We have been doing code reviews for a couple weeks now. I find it hard to understand VB code. So when they say what its doing, for the most part I just have to take their word for it.

If I do see something that looks wrong, I explain my opinion and I explain how I would address it in one of the languages I know.

Sometimes my suggestions are welcomed but many times I am told things like "this is the best way of doing it in this language" or "that doesn't apply to this language" or similar things of that nature.

This may be true, but without knowing the language I am not sure how to confirm or refute these claims.

I know one possible solution would be to learn vb so I can do better code reviews. I really have no interest in learning vb (especially since I have a list of other technologies I am trying to learn for my own projects) and would like to keep this as a last resort but it is an option.

Another idea that came to me is, they both have interest in C# and so do I. Its relative to them because its .net and relative to me because its more similar to the languages I know. Yet it is new to all of us. I thought about the benefits of us all collaborating on a pet C#.net project and reviewing each others code from that.

I guess theres also the possibility hiring a consultant to come in and give us some code reviews.

What would you recommend I do in this situation.

Best Answer

Your personal desires to learn other things should take a back seat to learning what you actually need right now for your job. Learn VB.net. You can effectively code review code you don't understand when you know the language it's in by asking lots of questions (usually that's a sign the code isn't well written if you know the language and can't figure out what its doing and why). But not understanding the code, the best you can do is get them to explain it to you and hope they will see any bugs through the process of explaining it. Not that I haven't found bugs in my own code in a review by doing just that, but it isn't the most effective way to code review. Code review is now part of your job, deal with it and learn what you need to learn to do it effectively.

While you are learning, when they say well that isn't the way we do it in this language, make them show you a source that says it is a good technique to use. It's up to them to justify to you in a code review not the other way around. You'll also get better at the language once you start seeing those links.