Clean Code & The Boyscout Rule

22 views
Skip to first unread message

Björn Kimminich

unread,
Nov 19, 2012, 9:05:52 PM11/19/12
to zaproxy...@googlegroups.com
Hey guys,

I'm not only quite test driven :) but even more than that I am a follower of the "Clean Code" idea. (If you don't know this book by Robert C. Martin aka "Uncle Bob", you should really pick it up. It's one of those rare gems among IT literature that can heavily influence your carreer!)

One of the aspects of "Clean Code" is to get away from the Broken Window approach which basically goes like "Oh, there already are seven nested if-else blocks in this 400 LOC method? Who the hell cares if I add an 8th one?!". The opposite approach of this is the Boy Scout Rule which - coined for programming - suggests: "Always check in your modules cleaner than you found them".

So my impulse when seeing things like
  • an ill-named class, method or variable
  • an inline comment that's redundant or misleading
  • some redundant piece of code
  • commented-out code
is to simply clean those up. Before I start doing so, I would like to check what you think of this approach. If you want to find out more about Clean Code I recommend reading the book(s) and/or watching Uncle Bobs "Clean Code" videos on http://www.cleancoders.com/. Or you can just ask me. Together with a former colleague I trained a total of ~80 developers inhouse (split among five two-day workshops) so far in 2012, so I'm quite deeply immersed into this topic.

TLDR: When I see bad code, I'd like to fix it immediately! Is that ok for you? ;-)

Regards,
Björn

psiinon

unread,
Nov 20, 2012, 4:09:34 AM11/20/12
to zaproxy...@googlegroups.com
Absolutely - I completely agree with this :)

And I've added it to the Dev Guidelines - anything else that they should cover?

Thanks for articulating this so clearly!

Simon
Reply all
Reply to author
Forward
0 new messages