Don't wait until it's ready to merge
Merging complete features leads to conflicts. Conflicts lead to anger. Anger leads to hate. Hate leads to suffering.When you’re coding a new feature, how often do you merge your changes?
Do you wait until everything is done, then create a PR?
Or maybe you break the work into smaller chunks, and merge a few days, or few hours, of work together, when it feels “ready”?
Neither of these is optimal.
Both lead to your code being out of sync with the rest of the team. In the worst case, you’ll end up with some nightmare merge conflicts, with some fancy merge-weaving to get everything working again.
In the least-worst case, you’ll at least occasionally need to do some rebasing or merging, and minor conflict resolutions.
In either case, it’s waste. Resolving conflicts is one of the silliest things a developer could spend their time doing. It’s a form of rework that adds no value at all, when you consider it could easily be avoided.
How so?
Don’t wait until your feature is “ready” to merge.
Rather, merge as soon as it’s safe.
Do you need to add a new parameter to a function, then do something with it? What’s the smallest, safe change you can make? Maybe add the parameter and do nothing with it? Sure. Do that. Then merge.
Then do the thing. Or maybe just add the validation. Then merge.
After that, maybe do the full thing.
Get over the idea that you need to merge complete features. This leads to conflicts. Conflicts lead to anger. Anger leads to hate. Hate leads to suffering. Or something like that.