design icon indicating copy to clipboard operation
design copied to clipboard

Bringing up to code / boy scout rule

Open hadley opened this issue 6 years ago • 3 comments

The boy scout rule for code is to leave code better than you found it. But I think the full boy scout rule is important: “Always leave the campground cleaner than you found it". The thing that it's important here is "what is the campground?", because while you want to make sure code gets better whenever you touch, you shouldn't embark on a massive scheme of code cleanup before making small isolate change.

This is what makes me think of building codes: if you remodel your bathroom, you need to make sure all the electrical that you touch is up to code, but you don't rewire the whole house.

hadley avatar Jun 04 '19 15:06 hadley

But sometimes, equally, you need to make a small, contained, tactical change, in an old function that works.

Maybe styling is different? i.e. you should always restyle any function you touch? But maybe we really should just be restyling packages wholesale?

hadley avatar Jun 04 '19 15:06 hadley

@11rchitwood We use styler for same, the issue of wholesale restyling has to do with code review and tracking changes. Thus, strategically rolling it through packages piecemeal. https://github.com/r-lib/styler (But, yes, styler does, in effect, abstract away style).

batpigandme avatar Jun 04 '19 18:06 batpigandme