From d059b20ac408c1251406e42177dfab1c939afd1e Mon Sep 17 00:00:00 2001 From: Dickson Souza Date: Sat, 10 Feb 2024 20:35:06 -0300 Subject: [PATCH] added thing_08 in pt_br --- pt_br/SUMMARY.md | 2 +- pt_br/thing_08/README.md | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 pt_br/thing_08/README.md diff --git a/pt_br/SUMMARY.md b/pt_br/SUMMARY.md index d22fcaf..9f678da 100644 --- a/pt_br/SUMMARY.md +++ b/pt_br/SUMMARY.md @@ -8,7 +8,7 @@ 1. [A beleza está na simplicidade](thing_05/README.md) 1. [Antes que você refatore](thing_06/README.md) 1. [Esteja ciente da sua parte no todo](thing_07/README.md) -1. [The Boy Scout Rule](thing_08/README.md) +1. [A regra do escoteiro](thing_08/README.md) 1. [Check Your Code First before Looking to Blame Others](thing_09/README.md) 1. [Choose Your Tools with Care](thing_10/README.md) 1. [Code in the Language of the Domain](thing_11/README.md) diff --git a/pt_br/thing_08/README.md b/pt_br/thing_08/README.md new file mode 100644 index 0000000..de457ba --- /dev/null +++ b/pt_br/thing_08/README.md @@ -0,0 +1,15 @@ +# A regra do escoteiro + +The Boy Scouts have a rule: "Always leave the campground cleaner than you found it." If you find a mess on the ground, you clean it up regardless of who might have made the mess. You intentionally improve the environment for the next group of campers. Actually the original form of that rule, written by Robert Stephenson Smyth Baden-Powell, the father of scouting, was "Try and leave this world a little better than you found it." + +What if we followed a similar rule in our code: "Always check a module in cleaner than when you checked it out." No matter who the original author was, what if we always made some effort, no matter how small, to improve the module. What would be the result? + +I think if we all followed that simple rule, we'd see the end of the relentless deterioration of our software systems. Instead, our systems would gradually get better and better as they evolved. We'd also see *teams* caring for the system as a whole, rather than just individuals caring for their own small little part. + +I don't think this rule is too much to ask. You don't have to make every module perfect before you check it in. You simply have to make it a *little bit better* than when you checked it out. Of course, this means that any code you *add* to a module must be clean. It also means that you clean up at least one other thing before you check the module back in. You might simply improve the name of one variable, or split one long function into two smaller functions. You might break a circular dependency, or add an interface to decouple policy from detail. + +Frankly, this just sounds like common decency to me — like washing your hands after you use the restroom, or putting your trash in the bin instead of dropping it on the floor. Indeed the act of leaving a mess in the code should be as socially unacceptable as *littering*. It should be something that *just isn't done*. + +But it's more than that. Caring for our own code is one thing. Caring for the team's code is quite another. Teams help each other, and clean up after each other. They follow the Boy Scout rule because it's good for everyone, not just good for themselves. + +by [Uncle Bob](http://programmer.97things.oreilly.com/wiki/index.php/Uncle_Bob) \ No newline at end of file