When I review the changes in a pull request, I sometimes stumble upon a comment with a "TODO" note which may be there for different reasons, in our case mostly because of:
- the solution used to solve a problem can be improved but would require significantly more time investment. An author chose a quicker solution but put a comment that a better option is potentially available
- there is a temporary code to workaround an existing bug that should be fixed soon
Knowing that TODO
s generally stay in the codebase for the lifetime of the codebase, how should I react to them in a pull request? How can I politely request to avoid it, or if it is really justified, how can I make sure the author of the PR would follow it up later in the future?
Best Answer
When you say that they "generally stay in the codebase for the lifetime of the codebase" in your team/department/organization, consider the following:
TODO
,FIXME
, or similar tags should be avoided.TODO [ID-123] Description ...
As mentioned in my comment, the last statement probably only makes sense in an environment that doesn't let tickets rot (e.g. if you follow a zero-bug policy).
Personally, I think
TODO
s are sometimes reasonable, but one should not use them excessively. Taken from Robert C. Martin's "Clean Code: A Handbook of Agile Software Craftsmanship" (p. 59):