I’m big on eliminating waste, I’m big on minimizing Work In Progress (WIP).
Here’s my story: a colleague asked me to pair with him because he broke the application and he didn’t know why. So we sat together. My first question was:
– “Did the app work before you made your changes?”
– “Ok, show me the changes you made”
I saw ~150 hundred unknown files, ~20 modified or added files. I said:
– “That’s a lot of changes. I bet you started doing too many changes at once so you ended up with a lot of WIP. Can we revert all the changes you made?”
– “Errr… I guess so. I know what refactoring I wanted to do. We can do it again”
– “Excellent, let’s clean your workspace now”
We reverted the changes. We also discovered that there were some core “VCS ignores” missing (hence so many unknown files in the working copy). We fixed that problem by adding necessary “VCS ignores”. I continued:
– “Ok, the working copy is clean and the application works OK. Let’s kick off the refactoring you wanted to do. However this time, we will do the refactoring in small steps. We will keep the WIP small by doing frequent check-ins on the way.”
– “Sounds good”
Guess what. We didn’t encounter the initial problem at all. We completed the refactoring in ~1 hour doing several check-ins in the process. Previous attempt to the refactoring took much more time due to few hours spent on debugging the issue.
Here’s my advice for a developer who wants to debug less & smile more:
- Understand what is your work in progress; keep WIP under control; keep it small.
- Develop code in small steps.
- Keep your workspace clean, avoid unknown or modified files between check-ins.