4 ms·
I'm not sure you're disagreeing with the post you're replying to? I tend to use FIXME for things that really do need to be fixed, and will not push code contai
by sfink 1y ago
I'm not sure you're disagreeing with the post you're replying to?
I tend to use FIXME for things that really do need to be fixed, and will not push code containing a FIXME comment. Grepping for FIXME is useful.
I tend to use TODO for things that I'm thinking may be useful, but aren't necessary (yet). Sometimes it'll be "TODO: Figure out whether..." or "TODO: Validate this by measuring the impact, to see if it'd be better to do something more complicated or simpler." I could rewrite all of these as regular comments -- the latter might be "I have not validated the assumptions here via measurements; something simpler might be good enough." But the TODO is a little more direct. Grepping my code for TODO isn't that useful. (Well, save for the comment block at the top, where I tend to leave actual todo comments, but they're still future tasks not FIXME-style "do this before landing" tasks. And I label them with [ ] checkboxes, not "TODO".)
So we agree: don't use the same tag for both. It sounds like you use TODO for "we need to change this" and I use FIXME for that. I suspect we all have a broad range of labels: TODO, FIXME, NOTE, plain comments, comments linked to bugs, etc. When reviewing teammates' code, I check whether their TODO comments should have a bug link, should not say "TODO", should be removed entirely, or whatever.
- kstrauser 1y agoI don't disagree with any of that. But we're talking in the context of this article, which includes 2 example comments: // TODO: Write the second half of this file so next week's launch won't explode then sure, you should probably track that somewhere. and // TODO: If the user triple-clicks this button, the click handler errors because [xyz] So my comment is also in that context of using the same tag for things of wildly different importance and urgency. And that would drive me to drink. Definitely come up with a local convention for which tags mean what, and pick whatever resonates with your team. TODO in your org can mean something different from mine, and that's perfectly fine. Just please, please use different tags for different things, as you're recommending.
- sfink 1y ago> So my comment is also in that context of using the same tag for things of wildly different importance and urgency. Ah, ok. That's fair. I agree that the example comments ought to be considered different categories. That first one is a TODO that is for doing. > And that would drive me to drink. Is that a bad thing? It depends on what you're drinking.
- kstrauser 1y agoI was just given a bottle of Booker's Bourbon, batch 2023-01 (https://www.bookersbourbon.com/bourbons/2023-01-charlies-batch https://www.bookersbourbon.com/bourbons/2023-01-charlies-bat...), but I haven't gotten the nerve to break the seal yet. Or since receiving it, had a day wonderful enough to justify celebrating with it, for that matter. Soon, though.