I love pull requests. Done right, they result in better, more readable code, and fewer bugs. But we can improve traditional pull requests and make them even more useful.
A good pull request is not one that is approved by everyone without a single comment. Quite the opposite. A good pull request is full of comments, questions, and good discussions. In a good pull request, the code is in better shape when it’s merged than when the pull request was opened. And a good pull request is one where both the developer who opened the pull request and the reviewers learned something.
To accomplish all this, the development team members have to agree that a pull request is a free zone. Every reviewer is allowed to scrutinize every piece of the pull request, and question everything about it.
But even if the pull request is a free zone, the development team has to keep it civil. Nasty comments and personal attacks are not allowed. The pull request is about the code, not the developer who opened it, or the reviewers. If things get personal, many developers will be reluctant to engage in pull requests, and they won’t reach their full potential.
An issue with traditional pull requests is that they are personal the minute they are opened. You can see the name – and often picture – of the developer who opened it and all the reviewers.
So to rid pull requests of their unfortunate personal bias I propose that we make them completely anonymous.
Respect My Authoritah!
Starting as the new developer in a company or a development team can be a rough experience. You have to get to know new colleagues, all the particular ways the development team do things, and, more often than not, you have to learn a completely new domain language.
On top of that, the development team wants new developers to open pull requests so people can look at their code, and have them review other developers’ code! As a new team member, that can be overwhelming and a little scary, for both junior and senior developers alike.
In some development teams, the senior developers – and often one particular senior developer – have too much power. Their opinion is the law, and they don’t take well to constructive feedback. That’s an awful work environment, and the other developers will slowly wither and die – at least figuratively.
The opinion and feedback of every developer is equally important, no matter their experience and seniority. New team members are not locked in the team’s old ways of doing things, and they have often picked up a few tricks from previous work assignments.
Junior developers with little or no prior work experience also have a lot to contribute. The lack of experience will (hopefully) make a junior developer ask “why”-questions, which often foster great discussions that can lead to valuable change.
We have to make it easier for every developer to come out of their shell, and end the reign of terror of some senior developers. Anonymous pull requests can potentially remove the barrier between new team members, old team members, junior developers, senior developers. They could also stifle venomous bias towards gender, sexual orientation, and ethnicity.
Brace For Trolls!
In general, anonymity on the Internet is a terrible idea. It brings out the absolutely worst in people. Reading the user comments on any news site will quickly make you lose all faith in humankind. (So don’t read the comments.)
The same can happen with anonymous pull requests as well, in particular if you work with assholes. Because of this, it can be tempting to make it possible to de-anonymize a pull request comment to reveal who posted it.
I’m not sure if that kind of feature is a good idea. Yes, it might deter some asshats from becoming uncivilized. But it might also stop someone with valuable feedback, questions, and ideas to post them since they are not truly anonymous.
Instead, I suggest that the development team adopt the Don’t Be A Dick-principle for their pull requests. Everyone is allowed to comment everything on their mind on a pull request – but Don’t Be A Dick about it!
(And if someone turns out to be a pull request jerk, you probably all have an idea who it is anyway.)
State of the Nation.
Now that we have all agreed that anonymous pull requests are the best thing since sliced bread, can’t we just start doing it?
Unfortunately, no. As far as I can tell, none of the more popular version control services like BitBucket, GitHub and GitLab support anonymous pull requests out of the box. There are some 3rd party tools available for GitHub, like Anonymous Github, Blind Code Reviews, and gitMask. You might want to have a look at them if your development team is using GitHub.
Perhaps the lack of tool support means that anonymous pull requests is a terrible idea? No. Research has shown that traditional pull requests are biased.
[…] our results show that women’s contributions tend to be accepted more often than men’s. However, women’s acceptance rates are higher only when they are not identifiable as women.Abstract from the study Gender differences and bias in open source: Pull request acceptance of women versus men.
As a software developer, you probably spend the majority of your time debugging, reading, and sometimes desperately trying to decipher other developer’s code. But that’s not the most interesting and intriguing part of being a programmer, is it? You’d rather write code, solve a problem, and deliver some actual value!
If the legacy code base you’re looking at had been through proper pull requests, there’s a good chance understanding the code would have been easier. Pull requests lead to better, more readable code with less bugs. We don’t need empirical research to tell us that1, it’s a fact of life.
As we’ve discussed at length, traditional pull requests can have a considerable personal bias attached to them. To remove the bias, and make pull requests even better, they should be made anonymous.
Now all we need is proper tool support.
This post is also available on Medium.
- But someone still did a little research on the topic.