I am using rust, but this applies to many other languages, I get warnings like, dead code, unused variables, and etc, and while I remove most of them, there are some im not sure of, I like running my program and there being 0 warnings, or 0 warnings as i scroll down my code, so for things im unsure of, i mark them so the compiler doesn't put warnings there. I also add comments, starting with TODO:, it has some information about what to think about when i revisit it, also the todo's gets highlighed in my IDE with my extension, but is this bad practice?

you are viewing a single comment's thread
view the rest of the comments
[–] 7 points 5 months ago*

Could also do this:

#[expect(lint, reason = "TODO: #issue")]

Edit: to clarify, #issue is an issue number that points to a related issue or task. Could also just explain it inline, but if you have a task tracker, better to make a task instead.

  • source