r/ProgrammerHumor • • 17h ago

Meme checkBuildSettings

Post image
2.9k Upvotes

67 comments sorted by

View all comments

Show parent comment

20

u/generally_unsuitable 11h ago

Nah. Ignoring warnings creates notification fatigue. Clean your builds until they're silent

16

u/PrincessRTFM 5h ago

For years, my argument has been that if the warning is correct then it should be fixed, and if it isn't then it should be explicitly suppressed at that location. I don't give a fuck that it's "just a warning", warnings exist for a damn reason. Either the compiler is right and that code isn't doing what I expected, or I know better and I should save myself and any future maintainers effort by adding a suppression and explanation. The only reason I don't set all warnings to be errors is because some of them trigger while I'm still writing my code and I want to be able to test in stages.

7

u/Prawn1908 3h ago

Exactly. Warnings either get corrected or locally suppressed with a comment right above the #pragma explaining exactly why it's safe.

8

u/PrincessRTFM 3h ago

my favourite is the way rust does it: #[expect(whatever)] will emit a warning if no warning of category whatever is emitted. if you refactor things and that warning is no longer relevant, you need to remove the suppression, and using expect instead of allow is perfect for that.

4

u/raunchyfartbomb 3h ago

Oh, you used a ternary instead of an if? That’s warning because for some reason the new visual studio doesn’t like it.

Your using “new X()” instead of “new()”? Gtfo

Your extension methods for IServiceProvider don’t exist within a project named “System”? (IDE0130)

Some warnings are noise.

8

u/Prawn1908 3h ago edited 3h ago

Nothing pisses me off more than those stylistic warnings. I have my own style that makes sense to me and my coworkers and we follow strictly, and we're not going to go refactor our whole codebase every time Micro$lop adds new syntactic sugar to C#. I hate languages that try to impose their own style on me, and integrating that into the compiler at the same level as real warnings about potential dangers is offensive.

However, those warnings get suppressed, not ignored.

4

u/generally_unsuitable 1h ago

Exactly. You turn them off explicitly because 278 stylistic warnings will hide one real warning that causes issues.