this post was submitted on 01 Mar 2026
25 points (96.3% liked)

Programming

25861 readers
352 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

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
[–] vext01@feddit.uk 17 points 1 day ago* (last edited 1 day ago)

It's not ideal.

Depending on the kind of warning, you may be able to re-write the code in question including a 'todo!()' to capture the "i need to think about this" case.

This way you get a crash at runtime. This is preferable to continuing execution with incorrect computation.

It's best just to fix the warnings ASAP. They are usually trivial anyway.