9 ms·
> Warnings are pointless. They are nothing but noise and invisible ... I absolutely abhor the the trend to accept that this is OK. Your code shouldn't generate
by ranting-moth 3y ago
> Warnings are pointless. They are nothing but noise and invisible ...
I absolutely abhor the the trend to accept that this is OK. Your code shouldn't generate warnings and the build system should treat them as errors.
- BoiledCabbage 3y agoIf they should be treated as errors then how are the different than errors? The only difference between a warning and an error is if it's ignorable to still proceed to execution. If it isn't it's an error, if it is, it's a warning. If all warnings should stop builds then they are no longer warnings. And to be clear you can argue that point - that there shouldn't be such a thing as a warning. And that's a fair argument to make (regardless of if I agree or disagre), but saying "the build system should treat all warnings as errors" isn't really coherent.
- ranting-moth 3y agoBecause to the compiler errors are non negotiable. It doesn't understand what you are trying to say. Warning is the compiler saying that yes, he understands but you're probably doing it wrong. Unused variable. Yeah, legal. But why? Most code that generates warnings can be written in a way so it doesn't. For the rare extreme nonsense warning, deactivate that warning with a comment and justification why to the next reader. Because if you don't treat warnings like errors they become just a background din. > ... isn't really coherent. It's supported by many compilers and isn't a new idea.
- orwin 3y agoYes! The code you deploy should be compiled with stuff like -Werror or whatever will stop the deployment if a warning exist. It's fine for development but it encourages lazy practices. Any accepted warning should be explicitly declared in code.