Stacked Diffs Can Be Expensive: Why You Should Do It More

submited by
Style Pass
2024-11-28 20:00:05

There has been a recent uptick in online discourse about “stacking”. Some folks have been doing it since the dawn of time with nothing but git and their bare hands. Others are learning about it through newer dev tool startups like Graphite, that are focussed on making it the de-facto development workflow. Everyone, however, seems to be in general agreement that stacking is the way forward, so let us unpack why.

Stacking is a git workflow where you break up large code changes into several, smaller pull requests that build on top of each other. Tinier building blocks mean that the changes can be tested, reviewed and merged in isolation, without blocking the development of dependant features. Developers can continuously work on their feature branch while chaining small, dependent changes known as stacked diffs. Here’s a simple visualization that should convince you why this is more efficient for developers.

Engineers at Facebook and Uber have been developing like this forever. Newer companies, like Cockroach Labs, are also enforcing similar best practices to maintain a high level of code quality. Dare I say it is becoming increasingly uncool to push out a 1000 line patch, as good as it feels.

Leave a Comment