Code
#
RefactoringWe are proponents of the Boy Scout rule "Always leave the campground cleaner than you found it. If you find a mess on the ground, clean it up regardless of who might have made the mess." In software what that means is make sure the code you check in is cleaner than the code you checked out.
#
BenefitsIf followed consistently and applied properly, it will be our most effective tool in managing tech debt.
"I think if we all followed that simple rule, we would see the end of the relentless deterioration of our software systems. Instead, our systems would gradually get better and better as they evolved. We would also see teams caring for the system as a whole, rather than just individuals caring for their own small part." - Robert C. Martin
#
The Boy/Girl-Scout engineer's releaseTo ship on time and spend clean-up capacity on the most important things, I need to:
- Be aware of all the things I could clean up.
- Identify those things most worthy of my attention.
- Keep track of that list and attend to the top items, according to my capacity.
- In effect, whenever they open their code editor, Boy/Girl-Scout engineers need to clearly define their campground; they need to survey the landscape for potential things to clean up, rank them by order of importance, and keep track of their clean-up progress as they work towards shipping time.
#
Linting and code formattingWe use Rubocop, a Ruby static code analyzer (a.k.a. linter) and code formatter across our Ruby codebases. Rubocop's rules are configurable, but to keep our code styling consistent across our codebases, we use a single set of Rubocop rules across our codebases. These rules / styling definitions are enforced as a step in CircleCI.