The Boy Scout rule

The Boy Scout rule is "Always leave the campground cleaner than you found it".

From a programming perspective, "Always leave the code better than you find it".

If you're working on some code and see some commented-out lines or unused variables, once you've finished with your changes, remove them too.

If there's a variable that could have a more descriptive name, change it.

If there are any other refactors you can do, do them and leave the code better than before and easier for the next Developer (whether it's you or someone else) to work with.

- Oliver

Was this interesting?

Sign up here and get more like this delivered straight to your inbox every day.

About me

Picture of Oliver

I'm an Acquia-certified Drupal Triple Expert with 17 years of experience, an open-source software maintainer and Drupal core contributor, public speaker, live streamer, and host of the Beyond Blocks podcast.