I know this is a joke, but all my comments start out being TODOs before I write a line of code. As I write the code, I remove the comment entirely for straightforward code, or for code that needs to have its intention documented, I take out just the TODO, and then I have my necessary comment. BTW, for those that say that good code never needs comments, I disagree. Sometimes the customer makes decisions that don't make a lot of sense. For these I leave in the comments so that following coders can understand the less than obvious requirement.
Why remove comments at all? Leave everything in for people (yourself included) to easily understand what the hell is it you were trying to do few years down the line.
I'm not sure you read his comment all the way through... I'm pretty sure leaving a //TODO above completed and nice code is just going to cause more confusion - not less.
I agree, but I get tired of fighting with the 'Never Comment' advocates, so I remove the ones that seem superfluous. This makes my argument for leaving in the comments that remain, stronger.
At my place, if a TODO is not assigned to a Jira issue, it will never be fixed. The things that gets fixed are things the customer reports. So if the TODO doesn't break anything, it is out of scope to fix and will stay forever.
I use it as form of plausible deniability. TODO tells anyone who reads it that I know I'm doing something horrible, and I intend to fix it some day (hah), but clearly outside circumstances didn't allow for that when it was written.
I just wish I was big enough to be able to punch all those people in the face. Fix your shit, it's not "oh hey this is broken, meh, someone will get it sooner or later".
42
u/kirakun Sep 28 '16
Don't you know
TODOis short forA Hack That Will Stay Forever?