hjertnes.blog

Infinite refactoring

10.11.2019 09:33

When I work on some personal project (I also do it at work, but it is less bad there because people start to really mock me when I say in 4 standups in a row that I have been refactoring something ridicolus) I often find myself in the situation where I start by writing some models a few Controllers with the same form I usually do things.

Then I usually refactor things as I am going and re-writes things as I find better and cleaner ways to do it.

The problem is that this takes longer and longer the more code I have written. At work it is easy I clean up the stuff I actually touch and make some stories to clean up the rest. And leave it at that.

At home however I try to not end up just cleaning things up and actually move things forward. Because I’m the kind of developer that could spend forever making code work better, and look better instead of delivering features if I have the opertunity. And I write tests for almost everything.

Or I take an active choice in every unit of code if they should be tested or excluded from coverage.

To avoid getting into this infinite refactoring loop I try to kind manage everything in a text file (usually org or taskpaper) where I have a ordered list of tasks, where I try to keep a sensible mix of real work and stuff that’s just making things nicer.