Good Software Hygiene
I spent two weeks on the road with my family mostly camping. We camped eight nights in national parks - six of those in Yellowstone. It was an incredible experience. I made a small observation to share that I found parallels our work in software development as I emerge back into the civilized world. It’s important to practice what one of my former bosses called “good hygiene” for software development. What’s tricky is that good hygiene isn’t a constant - it depends on how dirty the working conditions. It’s important to invest more time when you’re getting more dirty. Even in code.
Sometimes good hygiene means spending more time if you’re working in rough conditions. I found that while I was camping, I washed my hands the same amount of time with soap and water. And yet the work I was doing - building a fire, setting up camp, generally getting dirty - meant my hands were always dirty. I had dirt under my fingernails constantly. It didn’t matter that I was still washing my hands at the same rate, with the same effort.
I spent two days in hotels on the way back from Yellowstone. During those two days, I continued to wash my hands at the same rate and my hands starting looking cleaner and cleaner. I wasn’t setting up and breaking down camp. I wasn’t working in the fire. My nails starting looking clean again. I didn’t look like I was camping any more.
In software development, I think of bug fixes and refactoring as elements of good hygiene. You can’t simply decide that you’re going to invest a set amount all the time. It depends on the quality of the code you’re working in whether you’re spending enough time on good hygiene practices. If you spend the same amount of time fixing bugs and refactoring on a brand new subsystem as you do on a legacy piece of code, you’re going to end up with the legacy code still looking ugly.