We often talk about the scouting rule of “always leave the campsite cleaner than you found it”, or in a software context “always leave the code a little bit better than you found it”.

If you see duplication in the code, then remove that before you leave the method. If you see poor variable names then fix those before you leave.

What we don’t talk about as much is how a culture of branching and Pull Requests (PR’s) actively discourages making small changes for that purpose. If I want to rename a method to make it clearer and know that making that little change is going to require real effort to go through a review process and manual merges, then I’m more likely to decide to just live with the original name, even if it is is poor.

Whereas if I can make that little refactoring and directly check it into mainline then it’s a very low effort change that contributes to the quality of the product. It’s become easy to do the right thing.

How many things do we have like this, that actively discourage us from doing the right thing?