4 ms·
>when it was time to review code, what we really looked out for were obvious bugs, problems with the design or architecture and where code should be located. Va
by nsfyn55 10y ago
>when it was time to review code, what we really looked out for were obvious bugs, problems with the design or architecture and where code should be located. Variable naming was inconsistent but no one really bothered to enforce them. I don’t blame them, making code review a nit-picky task really puts a damper on the mood.
As a veteran of a dozen different code review approaches I've identified a few properties of those that succeed and those that fail.
If you want your code review process to fail its easy just...
1. Make it about you and your preferences. Does this code adhere to my particular aesthetic preferences? Are the variables named the way I would name them? Do I consider this code readable? How can I force others to adopt my perspective? Remember the purpose of code reviews it to keep iron-fisted control of the code base such that it never becomes that dreaded "big ball of mud"
2. Demand that the team adhere to a set of rigid rules regardless of how practical their application is.
3. Most important focus mainly on the subjective qualities of the code(format, spacing, naming, etc.) Allow non-critical path items to hold up delivery and use those items to critique others based on an arbitrary measuring stick.
If you want your code review process to succeed. Its a little harder....
1. Be problem focused. What has bitten you in the past? Are you sure you understand the cause? Acknowledge that there is no "right way" and that you will build the perfect code review model through trial and error.
2. Start with the bare minimum and build on it with a regular retrospective process. Allow your team(s) to take ownership of the code review process both as an expression of what they want to accomplish and as a way to improve their daily lives.
3. Accept that you might have been the one doing it wrong all this time.
4. Focus on the objective qualities in the code. Is this the best approach to solving this problem? Does it work? Are there any obvious bugs? Based on our collective experience will this code cause problems later?
5. If you feel like you are nit picking then you are nit picking. Don't nit pick.
Code reviews can either be a tool to write better code or a form of weaponized OCD. Don't be the latter OP, you're better than that.
- fourneau 10y ago"Weaponized OCD" is my new favourite way of describing bad code reviews.
- KKKKkkkk1 10y agoNice summary! I had the problem of one team member who was underperforming and felt the need to use your (1)-(3) as a way to slow down and put down the work of others. Sure, this is a "people" problem and not a "code review" problem, but it seems that mandatory code reviews can give a lot of power to a few bad apples and can actually magnify people problems.
- deleted 10y ago[deleted]