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?

  • BeigeAgenda@lemmy.ca
    link
    fedilink
    arrow-up
    4
    ·
    19 hours ago

    I like to treat warnings as errors and refuse releases with errors.

    Occasionally I disable single warning in a specific file because it does not make sense.

    Using TODO also makes sense, I’m mostly used to seeing them years after when debugging.

    In your case it sounds like you may end up ignoring all the TODO’s as too many of them become noise. I would instead disable the specific warnings in the compilers options, instead of in the code, and then deal with the remaining.

    Later you can disable one warning at a time and fix it.