Skip to main content

Respect and Code Reviews

Code Reviews in a development team only function best, or possible at all, when everyone approaches them with respect. That’s something I’ve usually taken for granted because I’ve had the opportunity to work with amazing developers who shine not just in their technical skills but in their interpersonal skills on a team. That isn’t always the case, so I’m going to put into words something that often exists just in assumptions.

You have to respect your code. This is first only because the nature and intent of code reviews are to safeguard the quality of your code, so even having code reviews demonstrates a baseline of respect for that code. But, maybe not everyone on the team has the same level of respect or entered a team with existing review traditions that they aren’t acquainted with.

There can be culture shock when you enter a team that’s really heavy on code reviews, but also if you enter a team or interact with a colleague who doesn’t share that level of respect for the process or the code. This mismatches can lead to conflict, arguments, resentment. They can lead to dwindling code quality and eat at the respect and will the whole team has for adhering to the code review.

Hold fast if a new member joins your team who doesn’t buy into the code review sanctity. They will often take code review feedback personally, and their apparent disregard for your suggestions is easy to take personally, as well. That’s a recipe for bad blood and arguments, so try to defuse it quickly.

This brings us to the next respect you need to have.

You have to respect your teammates. You aren’t a collection of programmers who just happen to be working on your tasks in the same codebase. You don’t function independently within the team but as a unit. Code reviews are one thing we do to guide and enforce that idea.

The respect for your teammates goes both ways during a code review. There is respect from the reviewer to the reviewee, as well as the reviewee to the reviewer.

As a reviewer, your attitude and approach can make or break your colleagues' respect for the process, the team, and you. There are some easy tips in the feedback you give and especially in how you give it, which can make them easier for both sides.
  • Try to avoid blaming “you” language. Don’t say “You didn’t do this right” when you could say “This would be less likely to break if…”
  • Use “we” language to convey the team ownership of the code. If some code convention wasn’t followed, don’t say “I prefer that you…” or “You incorrectly…”, rather say “We always follow array items with a comma, even the last one.” etc.
  • When using “I” language, use soft phrasing. Don’t say “I need” or “I know”, but “I usually” or “I’ve always found”.
  • Just be respectful and review the code for the team, not against the reviewee.
You have to respect your reviewer. I’ve given most of this advice from the perspective of reviewing code, but this rule is all about having your code reviewed.

The first rule of having your code reviewed is “Don’t take the code review personally”. Your code is not a reflection of you and it is never perfect. Your approaches can be great, but everyone can have valuable feedback. Accept feedback with some empathy and humility.

The second rule of having your code reviewed is “The team reviews your code because the team owns your code.” You do not own your code. Even when you’ve just written it when no one else has touched it yet, even if you put hours of effort and sweat into it. You do not own your code, this bears repeating. So, when your code gets reviewed remember that what eventually ends up in the project has to meet the team’s standards and idiosyncrasies. Often, it is essential that you bend your own preferences. You have to allow the code to work for the whole team, even changing your vision. Our code styles and practice should be in context to the team and project we work in, so don’t be completely tied to one approach, even if it’s your favorite approach.

You have to respect yourself. I’m not to write this without including the respect you need for yourself because the rest of the article was dominated by everyone else. Of course, this can mean a lot of things.

Respect yourself to speak up or push back when feedback you get really is wrong, in your opinion. Make your case strongly, but still keep all the advice above in mind when finally coming to a conclusion.

Respect yourself to be a little dignified responding to code review feedback. Don’t take it personally and look petty. Don’t ignore any bits of the feedback without making a case for why, looking dismissive. Don’t get angry about changing code you really looked and highlight your ego.

Respect yourself enough to look good in your teammates' eyes at the end of the process so everyone can be happy with what finally goes into the project and shared by the whole team.

Comments

Popular posts from this blog

Why I Switched From Git to Microsoft OneDrive

I made the unexpected move with a string of recent projects to drop Git to sync between my different computers in favor of OneDrive, the file sync offering from Microsoft. Its like Dropbox, but "enterprise."

Feeling a little ashamed at what I previously would have scoffed at should I hear of it from another developer, I felt a little write up of the why and the experience could be a good idea. Now, I should emphasize that I'm not dropping Git for all my projects, just specific kinds of projects. I've been making this change in habit for projects that are just for me, not shared with anyone else. It has been especially helpful in projects I work on sporadically. More on why a little later.

So, what drove me away from Git, exactly?

On the smallest projects, like game jam hacks, I just wanted to code. I didn't want to think about revisions and commit messages. I didn't need branching or merges. I didn't even need to rollback to another version, ever. I just …

On Pruning Your Passions

We live in a hobby-rich world. There is no shortage of pastimes to grow a passion for. There is a shortage of one thing: time to indulge those passions. If you're someone who pours your heart into that one thing that makes your life worthwhile, that's a great deal. But, what if you've got no shortage of interests that draw your attention and you realize you will never have the time for all of them?

If I look at all the things I'd love to do with my life as a rose bush I'm tending, I realize that careful pruning is essential for the best outcome. This is a hard lesson to learn, because it can mean cutting beautiful flowers and watching the petals fall to the ground to wither. It has to be done.

I have a full time job that takes a lot of my mental energy. I have a wife and a son and family time is very important in my house. I try to read more, and I want to keep up with new developments in my career, and I'm trying to make time for simple, intentional relaxing t…