The Boy Scout Rule in Coding

Leave it better than you found it

Image for post
Image for post
Photo by Gilles Trenson on Unsplash

The scout’s rule

Try and leave this world a little better than you found it, and when your turn comes to die, you can die happy in feeling that at any rate, you have not wasted your time but have done your best.

Always leave the campground cleaner than you found it

Uncle Bob’s interpretation

Always leave the code you’re editing a little better than you found it

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.

Writing good code

Conclusion

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store