Tuesday, September 20, 2016

Pitch In

Pitch in

So yeah the Boyscout Rule is awesome, but I know you are busy and you don't always have time for cleaning up everyone else's mess.  What I'm saying here is at least clean up your own trash.  You might not have enough time to leave it a better place, but what you can do is make sure your stuff isn't increasing the problem.

Give yourself a code review. 
Before you do a check in do a compare to the previous and see if you can see anything out of place.  Do you have any unused variables, do you have excessive spacing, is there huge methods that should be extracted, is it Clean Code, is it following the DRY principle?  Yeah this is the same stuff you'd do in a code review for someone else, so you're actually getting practice at code reviewing.

I know this sounds like a huge pain, you just spent a bunch of time just trying to get this thing to work at all and you write amazing code by default.  Great for you, then think of this as a chance to bask in the glory of reading your amazing code one last time before sharing that flawless gem of code with your source control.  For the rest of us, it's a chance to refresh your memory of all the things you did and possibly pick up some of the trash you may have dropped accidentally.

In the end you will now be committing code that will not need to be cleaned up by someone else (or yourself). Compared to doing code clean up on it later you'll be saving time, because you'll never be as familiar with the code as you are right now.  This gives you an opportunity to review code, refactor code ,fully understand the changes you just made, and check in the best possible code you are capable of generating. To paraphrase Ghandi "Be the clean code you want to see in the source".

Photos: Pitch In

No comments: