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

Birat Rai
Birat Rai
Sep 29, 2017 · 2 min read

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:

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store