Startup development teams need to optimize for speed. Code needs to ship quickly to validate ideas, and it needs to turn on a dime as feedback comes in. Perfect code that solves the wrong problem or ships too late is of no use to the company.
But speed needs to be balanced with quality, and one of the most effective tools for ensuring quality (as well as sharing knowledge and coordinating) is code review.
Sadly, most existing solutions for code review involve an undue sacrifice of velocity. But after trying various workflows over the past few years, I’ve got something I feel pretty good about. By layering a few scripts on top of GitHub and Reviewable, it’s possible to balance code review and speed.
Pull requests are a great idea for large open source projects, where whole concepts are either accepted or rejected by committers, and velocity is less important than quality. Unfortunately, the dominance of GitHub has also made them the default workflow for commercial software development, even thought it it slows things down. Pull requests are just too heavy.
At Google, one of the things I loved was how we worked in master, in one repo, with almost no branching, very frequent commits, and new functionality guarded by feature flags. Aaron does a great job writing this up in the context of Chromium. Committing frequently into master (sometimes called trunk-based development) has a lot of benefits and few downsides.
Google relies on custom tooling to make this work, though, so what’s a person to do?
At Foursquare, we used Facebook’s code review tool, Phabricator. Phab ostensibly provides all the benefits of a Google-style agile workflow — review code written against master, and just commit to master when you’re ready. But in practice, it wasn’t satisfying.
Given all of this, I was determined to find a middle ground for our new engineering team at Scroll. Our solution uses a shell script, a tiny go server on Heroku, and Reviewable to do a few things.
We’re just starting out with this code workflow, but so far it’s great. We can review code, benefit from all the tooling built around pull requests, and still move with almost the same agility as committing directly to master. It’s not perfect, and it’d be interesting to hear what other folks are doing or how this solution works for you. Reply with your thoughts below, on HN, or to @krave on Twitter.
Hacker Noon is how hackers start their afternoons. We’re a part of the @AMIfamily. We are now accepting submissions and happy to discuss advertising &sponsorship opportunities.
To learn more, read our about page, like/message us on Facebook, or simply, tweet/DM @HackerNoon.
If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!