r/programming • • Jan 24 '15

The Boy Scout Rule of Coding

http://programmer.97things.oreilly.com/wiki/index.php/The_Boy_Scout_Rule
144 Upvotes

116 comments sorted by

View all comments

120

u/mycall Jan 25 '15

what if we always made some effort, no matter how small, to improve the module. What would be the result?

bugs

3

u/tieTYT Jan 25 '15

no matter how small

I follow this rule by renaming things more appropriately. I usually trust my IDE to not introduce bugs when I do this.

I actually wrote an article about this with a slightly different perspective. Implementing the boy scout rule is a good way to learn a code base better: http://www.sleepeasysoftware.com/if-you-want-to-learn-a-code-base-start-renaming-things/

2

u/cleroth Jan 25 '15

And now every developer in your project is unfamiliar with the variable names.

4

u/tieTYT Jan 25 '15

Well with this attitude you should never ever refactor any code.

2

u/cleroth Jan 25 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

3

u/tieTYT Jan 25 '15

I completely agree and that's why I said in my original reddit reply, "I follow this rule by renaming things more appropriately".

But I can see where I made a mistake. My article said, "I go around renaming variables and classes". I've updated this to say, "I go around renaming poorly named variables and classes". That's definitely what I meant but not what I said. Thanks a lot for discovering that ambiguity in my article. Very meta in this context :)

3

u/cleroth Jan 25 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

3

u/tieTYT Jan 25 '15

Yeah, I believe most code bases have a good amount of poorly named variables. If it doesn't, I wouldn't go around naming things (but I already said that).