Devil’s Advocate Code Reviews

Dan Kaplan
2 min readMay 4, 2021
How to do a self Knowledge Exchange

A few years ago, I was the solo developer on a project. Being a solo developer can be very difficult because it is all on you. I was petrified of making poor architectural decisions, introducing bugs that would take down the site, and writing sloppy code.

To help calm my fears I came up with a system — the Devil’s Advocate Code Review. Even though it was just me, I would still put up a Pull Request and be as brutal as I could be on myself. I would force myself to go through the exercise of debating myself to justify every line of code I wrote. I would also write PR comments that I could look back on with summaries of these debates so if the decision I went with was wrong, I had already come with another potential solution. This system helped me make my code the best it could be as I would often rely on SOLID principles, come up with refactors on the spot, and identify any missed use cases before my code was merged in.

Often we think about a lot of these things up front or in the middle of the software development process. But thinking about them again at the end as a final check is even more beneficial. At the end, you have more information than you did earlier, and a better feel for what is going on.

I am no longer a solo developer anymore but still use this process. Sometimes, when we finish a piece of work, we are so excited to put up as a PR (or just want to be done with it). Going through the Devil’s Advocate Code Review is a guard for me to do that final check and make sure my code is 💯. This process that has made me more proud of my Pull Requests and raised the quality of my work.

--

--