Day 2 - Nuke some TODO comments

Congrats on making it to day 2!

I’m loving the experience reports folks are posting on the form after completing the previous exercise. It’s super motivating to me to see you having success, so please keep sharing!

Today’s exercise is short and sweet: grep your codebase for TODO comments.

When you find one, I recommend you do one of the following:

  1. Is it out of date? Delete it.

  2. Is it still relevant? Delete it and add it to whatever system you use to track work to be done, like GitHub Issues or Trello or Asana.

  3. Are you unsure? Do a little research and/or track down the comment’s author and get an answer. Then do 1 or 2 :).

Why do this? Because code is a lousy place to track todos. When a todo lives in your code, it can’t be prioritized or scheduled, and tends to get forgotten.

For extra points, submit a PR that deletes all the TODO comments and include links to the newly-created issue for each one. Should make for an easy review/approval.

Worth noting: spend 20 minutes on this task and then declare victory. Success is showing up and putting in the time, not necessarily deleting every comment. If you can only delete one comment in 20 minutes, you’ve still succeeded for the day (well done!)

Finally, when you’re done, please share how old the oldest TODO comment you found.

Get to it!

2 Likes

:slight_smile:

Other common tags to grep for (highlighted by most IDEs): “FIXME” and "XXX"
Total todo’s: 204.
Oldest: 2012. (Start of the project)
Added last month: 19. (We should stop doing this…)

3 Likes

grep -ilrE 'todo|fixme' * might be useful. Finds all files containing “todo” or “fixme” in the current directory and subdirectories.

4 Likes

The first TODO I come across is…

-#- TODO: We need a dropdown of membership details's amounts that passes the membership_level_no to the backend
  = f.hidden_field :membership_level_no, value: "#{@membership_page.membership_details.first.membership_level_no}"
  this is what is making it work for me locally. I will not commit this and let you add the radio buttons in
  I am expecting the params to come in as params[:membership][:membership_level_no]
  please don't f it up
2 Likes

I might have been the kind developer that wrote that…:open_mouth:

1 Like

This is so true, I did it and immediately we started working on it!

rake notes is useful for Rails folk.

Most of our TODOs were 2 years old, added in “WIP” commits. The youngest TODO was 9 months.

2 Likes

On our oldest/largest project I updated 187 files, removed 350 TODOs and only had to create 5 tickets. Our code base definitely needs some sprucing up.

Oldest TODO was from 11/13/07: //TODO: This is stupid

1 Like

Oldest TODO was from 10/01/2017. But I found a really stupid entry.

// FIX EVERYTHING THAT DON’T WORK

Now I have 20 todos entries removed and the new todo has 14 entries (8 old entries modified, and 6 new entries to replace the stupid fix everything)

1 Like

52->30 TODOs. Some were very easy to delete. Others, needed some thought… The oldest one is from 2010.
Will continue cleaning this on my pomodoro breaks… Also added an item in our release procedure (sadly no continuous integration on this project :frowning:) to make sure all the TODOs are removed from the code and added to JIRA.

1 Like

I had never heard of XXX, what do you use it for?

The TODOs in my company project is there since around 2 years ago but the code was remain untouched since then, until recently I’ve been assigned to revamp the project and I realized that all TODOs mentioned are basically refactoring and optimization (and there’s one with something like “remove this line from Active Record” in Rails), I’m doing refactoring now but it’s on a macro basis instead of following the TODOs :smiley:

Happy to announce, that there are no TODOs in my current project, I put them in todoist :tada:
The only place I found TODO, was in place of the app, which was never used, so I deleted the whole folder :tada:

I am sure I am going to have oldest TODO item as I make living maintaining old codebase: it is still Windows XP application, written in Delphi 5 and using Paradox (database from 80s). There was no git or any other kind of versioning used for majority of codebase lifespan, but luckily they like to date the comments (like // TODO: …, 9. 1. 2018)

The oldest TODO I was able to find is from 3. 7. 1997

There are few more that I suspect might be from 95 or so as they are at module that was not touched for decades, but they are not dated, so who knows.

1 Like

When FIXME and TODO is not relevant I guess? (But you still want some extra emphasis)
Only time I used it myself was in some framework code, to make diffing a bit easier when updating the framework code by hand.

The only TODO comments I found in my Code are in external libraries. Phew, this one was fast! :slight_smile:

1 Like

37 TODO’s, FIXME’s and derivatives removed. All that’s left are present on external libraries. Was a good exercise to get rid of some outdated code (talking about an app with around 6 years of legacy code). Oldest TODO dated back to 2013, obsolete by now.

For the trickiest ones, I’ve added them to our tracker to be handled on pomodoro breaks as these gonna need some research work…

I was never a fan of using such things, and I have to agree that TODO’s and FIXME’s are where actionable items go to die… :blush:

https://github.com/codevise/pageflow/pull/937

Found three TODO comments (except for those in vendored JS) that could easily be removed. The oldest was from May 2014.

6 old ToDos removed.
I’m not a big fan of that kind of comments in my code anyway.
Nice habit to have though.
Next please :wink: