As a programmer, you have probably dealt with a task that seemed simple enough in the beginning but just keeps going and going and going. I have been chewing on such a task for the better part of the last three weeks and finally closed it today*. A really long time, considering I usually complete my tasks in less than a day, up to three days for especially long ones.
I know that many programmers can get lost with big tasks like this. I am certainly no exception. Analysis paralysis and decision fatigue can easily get the best of you, considering the mountain of work still ahead.
But I have a few ways to deal with such situations. Of course, your mileage may vary. But I am sure that without them, this specific issue would have taken me even longer. It boils down to one rule:
Focus on the essentials only.
This obviously relates to yak shaving. Sometimes you need to do something else first before you can complete your task. This is recursive and can quickly take up lots of time. This will ultimately be required, but for the moment it distracts from the original task. While you complete a side task, the main task will not advance, leading to a feeling of getting stuck, technical problems (like merge conflicts in long-running branches) and psychological problems (like decision fatigue).
So what can you do about this? My advice is to rigorously cut-off side tasks, by taking up technical debt temporarily. I annotate my code with HACK
, TODO
and FIXME
to mark all the isolated spots I still need to change for the 100% version. The end feature (= user story) does not have to be completed by the end of my task, but I should be reasonably confident that the main work is done. Anything to that end will work.
Some required changes immediately appear to be too extensive for such a small annotation. In that case, I will usually create a new follow-up issue in our issue-tracker and mark the code with a link to it.
After completing the main work in this way, but before I merge my code or close my original work-item/issue, I make another pass over all the HACK
, TODO
and FIXME
s I generated. The smaller ones I fix right away. Anything where the way to complete them is not super obvious gets converted into an issue in the issue tracker, and cross-linked from the code. This means I add a comment referencing the issue from the code and I make sure that the issue says that it is marked in the code. E.g., for this specific task, I now have 6 open follow-up issues.
After that, I usually merge the code into the main branch. If it’d break something or be misleading with all the follow up issues not done yet, the feature can sometimes be disabled with a feature toggle. Alternatively, the follow up tasks can be completed in their own branches and merged back onto the main task’s branch, which can be merged once everything is done. This hugely depends on your product cycle, of course.
Do you have any clever methods to handle bigger tasks?