Step 8: The Boy Scout Rule ~Robert C. Martin (Uncle Bob)

Birat Rai
2 min readSep 29, 2017

--

This is the Eighth Step towards gaining the Programming Enlightenment series. If you didn’t learn the Seventh step, read it.

“Leave Things BETTER than you found them.” ~ Robert Baden Powell

World would be a great place, if we all tried to leave things better than we found. It applies for the software too.

Software evolves radically and as it scales tech debt increases and maintenance nightmare starts. Developers leave and new one joins to maintain it. How many times we look a the git history and wished why someone didn’t maintained it. All wishes would have been true, had we all stuck to leaving the code better than before if not bad.

What is Boy Scout Rule?

The Boy Scouts have a rule: “Always leave the campground cleaner than you found it”.

How does it apply to programming?

No matter how much seasoned a programmer is, due to deadline constraints, we might end up adding tech debt. The must concern is that we do not add more smelling code.

As we check module to solve the bug or add new feature, we find out there is code smell. Whenever we see such smell, we should try to remove the rot, however small that could be. If all of the concerned developers followed this approach, the system would gradually get better and the relentless deterioration would stop.

The cleaning is to approach towards betterment not to perfection at each step.

Why follow Boy Scout Rule?

Developing software isn’t just applying the knowledge we learnt. It’s like a working with Bonsai tree, which must be pruned constantly and cared of. Caring for our own code is developers work, but caring and taking ownership of the team’s code is quite another.

TL;DR Continual Improvement is the way to learn and improve, be it as a developer or a software. Embrace Kaizen.

Go to the series.

Go to Seventh step.

Go to the Ninth Step.

References:

--

--