Don’t ever write // TODOs

Stefan Matar
2 min readFeb 19, 2020

Let me tell you a story about a project where there were over 130 TODOs open. I won’t tell you which company that was. But I can tell you that there were a wide range of types of TODOs in that codebase.

// TODO @lastname implement this once ________

Or another one

// TODO

Yes. Just “TODO”.

Literal Cancer

The problem with TODOs in our code base it that they are temporary “fixes” or even “markers” of organisational problems. If you can’t implement something because of X. Then don’t. Implement the MVP you can and simply do a task “Integrate XYZ” later.

Here are some arguments why you should not git push TODOs:

  • You forget to remove them. We all do.
  • People reviewing your Pull Request assume its an unfinished PR
  • Once they get merged you either need to find open TODOs to know what needs to be done
  • In a world with Jira or AzureDevOps or any other issue tracking software we should keep track of still-open-tasks there and not pollute our valuable codebase.

I understand when you currently write code and you need to refactor something so you add a TODO that lives for about 4 minutes. Everything above that or checked-in TODOs are imo unnecessary and should be solved elsewhere except your codebase.

--

--