One of the biggest surprises of the startup experience so far has been the pleasure of owning. I am not talking about owning a multi-million dollar company or any company for that matter. I am talking simply about making something when there was nothing there before and putting your name on it. It’s not a matter of perceived or objective or any other type of value that can be put on the the thing you are making, it’s just a private joy of building, identifying with and taking pride in what you’ve build.
I am not a stellar programmer, and I have not written that much code in my lifetime. But even when I did write something it was never my own. And now, for the first time, what I write is mine, and that is somehow a very different experience.
Isn’t 80% of code quality just the choice of font and formatting? :)
As a case in point, the code viewed in our git repository’s web interface somehow seems to much cleaner and more well organized than the same code in Eclipse. Psychologically that’s a good thing, and I’ve trained myself to look at the code online when the urge to refactor comes. If that doesn’t work, I look at the product backlog and listen to all the other stories calling my name. If by this point I am still not convinced, I run the unit tests and see the dots that roll across the console window, appreciating how much I prefer them to F’s (failure) and E’s (exception).
So when you are about to refactor something take a step back and… I don’t know, just say no.
On a more serious note, I think it’s a perfectly natural to want to tidy up the code, make things more ordered, more maintainable, etc., but if there is no immediate business issue behind it (especially if you are at the early stages), I feel refactoring anything is actually hindering your progress since it’s not bringing you any closer to your immediate goals. The odds are you are going to throw that code away anyways or discover that none of the customers want to use it.