Last week I was working with an away team, and in one of my code review, I got a comment from one of the senior engineer that, we should add
TODO for something which I will be adding in next reviews. My response to that was, “I am not a big fan of adding TODOs in code since they don’t add much value, especially when I’ll be working on that code in next few days iteratively and complete the full implementation”. That led to a healthy debate over whether TODOs add value to our code or not.
First off let me starting with my opinion and why I think it does not add value.
The argument made by the senior engineer was that, it’s easier to search for TODOs in code and all IDEs support easy look ups. This is a fair point, but I would question when and what motivates one to look up for TODOs. If you stumble upon one then that’s a different case, but is it an acceptable trend to periodically search your code base for TODOs?
I further did more research on internet and found mixed feelings about the use of TODOs. Some like it and some don’t. There is also a tool which creates a tracking task in your issue management system and resolves them once the TODO has been deleted. Seems intelligent. I would love to use something like that in future, until then, I am advocating not to TODO.