avatarBirat Rai

Summary

The web content discusses the "Boy Scout Rule" in programming, advocating for incremental improvements to code to prevent deterioration and maintainability.

Abstract

The article is the eighth step in the "Programming Enlightenment" series by Robert C. Martin, also known as Uncle Bob. It emphasizes the importance of the Boy Scout Rule, which is to leave things better than you found them, in the context of software development. The rule suggests that developers should make small improvements to the codebase whenever possible, such as fixing code smells or addressing technical debt, to gradually enhance the software and avoid a maintenance nightmare. This approach is likened to the constant care and pruning required for a Bonsai tree, highlighting the continuous effort needed to maintain software quality. The article encourages developers to embrace Kaizen, the philosophy of continual improvement, and to take collective ownership of the codebase for the betterment of the software and the team.

Opinions

  • The author believes that software maintenance becomes increasingly challenging as technical debt accumulates, and this can be mitigated by adhering to the Boy Scout Rule.
  • The article suggests that developers should not only care for their own code but also take responsibility for the codebase as a whole.
  • It is implied that the practice of making incremental improvements is more realistic and sustainable than striving for perfection in one go.
  • The author posits that following the Boy Scout Rule leads to a culture of continual learning and improvement within a development team.
  • The article hints at a broader application of the Boy Scout Rule, suggesting that if everyone followed this principle, the world would be a better place.

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

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:

Software Development
Boy Scout Rule
Code Smells
Java
Android
Recommended from ReadMedium