The Power of Stacking: Boosting Developer Productivity
Imagine you’ve just finished writing the new checkout flow for your shopping app, and now you need to add a promo codes feature. However, your first pull request is stuck in code review, blocking your progress. What do you do?
The Problem with Traditional Development Workflows
In traditional development workflows, you might consider working on something else, bothering your reviewer, or folding the new feature into the existing pull request. However, these approaches have their drawbacks. Working on something else can slow you down, bothering your reviewer can be distracting, and folding the new feature into the existing pull request can create a massive, unwieldy code review.
Introducing Stacking
There’s a better way: stacking. Stacking involves creating a new branch off an existing feature branch, allowing you to pick up where you left off without waiting for the original feature to land. This approach enables you to work on multiple related features simultaneously, streamlining your development workflow.
How Stacking Works
To illustrate the power of stacking, let’s consider an example. Suppose you’re building a Wordle game using React. Instead of creating a single, massive pull request, you can break down the development process into smaller, more manageable chunks. You can create a stack of pull requests, each focusing on a specific feature, such as:
- Use Create React App
- Add keyboard input
- Keep track of past guesses
- SCSS support
- Show which letters are correct
- Add a win condition and a reset button
- Add a real dictionary with words
- Deploy scripts
Benefits of Stacking
Stacking offers several benefits, including:
- Faster Reviews: By breaking down the development process into smaller, more focused pull requests, reviewers can provide feedback more quickly and efficiently.
- Improved Code Quality: Stacking allows you to test and refine each feature independently, reducing the risk of introducing bugs or errors.
- Increased Productivity: By working on multiple related features simultaneously, you can make the most of your development time.
Implementing Stacking in Your Team
To incorporate stacking into your team’s workflow, you can use tools like GitHub, which provides basic support for stacking. You can also use automated tooling to help manage the process. Some teams title their pull requests with the position in the stack, while others leave links to the rest of the stack in the description.
Common Objections to Stacking
Some developers may be hesitant to adopt stacking due to concerns about confusing their teammates or creating extra work. However, with the right tools and processes in place, stacking can actually simplify the development workflow and improve communication among team members.
Getting Started with Stacking
If you’re interested in trying stacking with your team, start by identifying a complex feature that can be broken down into smaller, more manageable chunks. Then, create a stack of pull requests, each focusing on a specific aspect of the feature. With practice and patience, you can unlock the power of stacking and take your development productivity to the next level.