Code reviews? What about pair programming, and trunk-based development?

The pull request model

The pull request model was popularized by open source.

  • When you have a team distributed across time zones. Given its asynchronous nature, team members don’t need to engage in social programming practices. This gives members the flexibility to contribute code and reviews on their own time.
  • When you have an established product. In such cases, time is not a constraint — you rarely need to iterate quickly. You want all code changes to be precise, to reduce risk of breakage.
  • When you have junior developers. Pull requests help you to check their work more closely. You can give them specific guidance on how to improve the functionality and readability of their code.

Trunk-based development

Trunk-based development was popularized by the agile movement.

  • When you have a co-located team, or a team in the same time zone. This simplifies the scheduling of synchronous, social programming sessions.
  • When you have a new product, and need to iterate quickly. In such cases, time is a constraint. You’re in the exploration phase — your customer will change what they want, and you’ll need to quickly pivot to change your product.
  • When you have mostly senior developers. You don’t need to watch their work closely, or give them much guidance about their code. You want to give them full autonomy.

Pull requests beat trunk-based development

Trunk-based development is one of the central ideas of continuous delivery. Other core ideas of continuous delivery involve automation techniques around builds, tests and deployments. These ideas are widely adopted across companies like Google, Amazon, Meta, Netflix, Uber and many others.

What about pair programming?

Pair programming is a great tool. Done well, it can result in better mentoring, knowledge sharing and team morale. It’s especially effective within the trunk-based development model, but it can also be used within the pull request model.

What about the term, code reviews?

Earlier, I mentioned that I post about code reviews often. But this is frequently a point of contention, and there’s opportunity to clarify here.

Operating within the pull request model is a critical skill — I’m here to help

The topic of pull requests versus trunk-based development is a common debate across the industry. Many influential developers have weighed in, arguing each side.

  • “I ensure high code quality in code reviews.”
  • “I… set and hold the bar for quality and best practices for my team (e.g. via code and design reviews)”
  • “I solicit and offer honest and constructive feedback that is delivered with empathy to help others learn and grow.”

Like this article?

Turns out, code reviews are my thing. Check out my video course, Master the Code Review! Individual and team licenses available.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Curtis Einsmann

Curtis Einsmann

Software engineer; solopreneur. Writing to help developers level up. All stories free. Follow me on Twitter for more: https://twitter.com/curtiseinsmann