Day 2 - Nuke some TODO comments

Learned a few things about this one:

  • listen to the advice about doing the activity as the first thing you do in a day. I came into work this morning & did a task around upgrading servers thinking it’d only take an hour or two, and it ended up eating my entire morning, had meetings in the afternoon, and another issue arose, so didn’t get to the challenge until this evening (it’s almost 8:30PM local time as I write this).
  • it’s interesting how TODOs evolve over time – we had a few TODO’s that were things like “TODO: add A, B, and C” but the TODO was now “TODO: add A” as B & C had been addressed over time, but the TODO no longer had context without the B & C in the TODO. When addressing part of a TODO, if you can’t address the entire thing make sure that the TODO still has meaning otherwise kill it.
  • a couple of TODOs I killed by adding a few unit tests.

Great little activity.

1 Like

I’m running a little behind - playing catch-up today! :slight_smile:
We had 41 TODOs in our main app. I was able to convert 12 into issues (some were shared interests, so it ended up being only 5 new tickets!), and outright delete another 7 of them as unnecessary/out-of-date/"wtf"s (Example: # TODO: What is this?)

Love seeing a 50% decrease in unnecessary bits! I also (maybe irony, here?) assigned a couple coworkers to the PR I submitted removing the TODOs and suggested they try tackling the remaining 21. I’d love to get more of my team involved in this process - we can make that 20 minute timebox way more effective.

(Also running behind with fires earlier in the week.)

Thanks @stianlagstad for the start! You led me to find/modify the following command (from StackOverflow) to be useful:
git grep -il TODO | xargs -n1 git blame | grep -i TODO

My (painful) results:

  • 124 TODOs going into this.
  • ~41 from our own (known-to-be-lower-code-quality) framework
  • 4 are the Spanish / Portuguese word “todo” (“all”)
  • Oldest: 2013-12-28 (within the first 3 weeks of the project…)
  • Newest: 2018-01-09 (uncommitted! That’s actually something I do, but now I want to set up a commit hook to catch it…)

Thoughts: this was a really useful thing to even just think about – I’ve now added a TODO to my To Do list (instead of code) to really spend some time cleaning up the ones I wasn’t able to quickly decide on.

1 Like

Main project I looked at today is only me and not the biggest fan of TODO / L8R work either. But I still found 10 TODO comments from various stages.

Rather than adding them to the issues list, I decided to just delete and since most were “do this better later” comments. I will refactor that stuff as I touch it later in a “make it better than you found it” way.

Looks like my earliest TODOs were the first month of the project, about 4 years ago.

I was able to tackle two main TODOs, one that was moving a file to a more consistent place.

Another was to convert a reference to a “carrier” to be a single and unified type through out our app. The latter was much more difficult and time consuming. It ended up taking more than 20 min, so paused and opened up a peliminary PR to come back to.

  • 156 TODOs
  • Most of them old and from a previous team. I am guilty of maybe ~10% of them.

Didn’t get a chance to ticket them. A lot look like they will be wiped out in the coming months since we are doing a lot of refactoring right now.

Only 2 TODOs in the same file.
The oldest was from 2017-03-30:

# TODO: Refactor

The other was:

# TODO: Create spec check

Killed a total of 10 TODOs across 2 repos :). That felt good :sunglasses:

Only one was relevant and moved to issue tracking, the other 9 were outdated.