Following this principle, teams can improve the quality of their code over time, while continuing to … In software, keeping code clean is a constant challenge, and developers and software teams must decide if, when, and how they will go about maintaining the cleanliness of their code. Developing software isn’t just applying the knowledge we learnt. So we must take an active role in preventing this degradation. The Boy Scout Rule Robert C. Martin (Uncle Bob) THE BOY SCOUTS HAVE A RULE: “Always leave the campground cleaner than you found it.” If you find … - Selection from 97 Things Every Programmer Should Know [Book]
Over time, the quality of the underlying source code of a system tends to degrade, accumulatingtechnical debt. When does it make sense to spend time working to improve the design of the codebase? This principle was featured in the 2011 Software Craftsmanship Calendar using the image below, as well as the 2016 Software Craftsmanship Calendar (with image above). It's not enough to write the code well. The code has to be kept clean over time. Can you imagine working on a project where the code simply got better as time passed?
The act of leaving a mess in the code should be as socially unacceptable as littering. They don’t take it upon themselves to ensure the entire campground is cleaned up, but neither do they simply trash the place but plan on coming back one week out of the year to do a proper cleanup job. — Functional Error Handling in Kotlin, Keep it Simple with the Strategy Design Pattern.
> Some teams take the approach of shutting down all value-adding work and simply trying to clean up the codebase for a week or a month or some other period of time. The Boy Scout Rule suggests an alternative approach, which is to simply try and ensure that with each commit, you leave the code better than you found it. Windows Programming.
Following this principle, teams can improve the quality of their code over time, while continuing to deliver value to their customers and stakeholders. Since the publication of Scouting for Boys in 1908, all Scouts and Guides around the world, as well as members of the affiliated Alpha Phi Omega service fraternity, have taken a Scout Promise or oath to live up to ideals of the movement, and subscribed to a Scout Law.The wording of the promise and law have varied slightly over time and among Scouting organizations. Maybe only slightly. Additionally, the Boy Scouts of America may adopt rules or codes of conduct for youth members, adult program participants, and adult leaders, as well as others for specific positions.
The must concern is that we do not add more smelling code. Developing software isn’t just applying the knowledge we learnt. The Boy Scouts of America have a simple rule that we can apply to our profession. Indeed, isn't continuous improvement an intrinsic part of professionalism? So we must take an active role in preventing this degradation. Software evolves radically and as it scales tech debt increases and maintenance nightmare starts. If all of the concerned developers followed this approach, the system would gradually get better and the relentless deterioration would stop. The Boy Scouts have a rule: “Always leave the campground cleaner than you found it”. Articles If you didn’t learn the Seventh step, read it. The cleanup doesn't have to be something big. It’s like a working with Bonsai tree, which must be pruned constantly and cared of. Home Embrace Kaizen. It applies for the software too. “Leave Things BETTER than you found them.” ~ Robert Baden Powell. Do you believe that any other option is professional? Leave the campground cleaner than you found it. How many times we look a the git history and wished why someone didn’t maintained it. A code of conduct is enforceable in the same manner as these Rules and Regulations.
We've all seen code rot and degrade as time passes.
Programming Change one variable name for the better, break up one function that's a little too large, eliminate one small bit of duplication, clean up one composite if statement. If we all checked-in our code a little cleaner than when we checked it out, the code simply could not rot.
Whenever we see such smell, we should try to remove the rot, however small that could be. This is the Eighth Step towards gaining the Programming Enlightenment series. The Boy Scouts of America have a simple rule that we can apply to our profession. Why follow Boy Scout Rule? Boy Scouts have a rule regarding camping, that they should leave the campground cleaner than they found it. TL;DR Continual Improvement is the way to learn and improve, be it as a developer or a software. Paying down this debt via refactoring is necessary in order to keep the code in a state where it is economical to extend and maintain it.