r/ProgrammerHumor • • Sep 23 '19

Knowing how to code beforehand

Post image
7.6k Upvotes

264 comments sorted by

View all comments

124

u/ythl Sep 23 '19

I don't get it.

Your code should never have warnings, that's a sign you are doing something sketchy. At my company we enable all warnings as errors.

76

u/LPExpert Sep 23 '19

Then what do I do about Java warning of an import not being used but that's definitely being used

52

u/ythl Sep 23 '19

Open a bug report with your Java compiler

59

u/Mohammedbombseller Sep 23 '19

Java warnings are very minor compared to C warnings though. C warnings are bugs waiting to happen, java warnings are usually minor formatting differences that are pretty safe to ignore.

5

u/LeCrushinator Sep 23 '19

Then there needs to be a distinction between a warning and a suggestion.

3

u/squishles Sep 23 '19

it's still your doing something messy in java usually.

my ignore line is intellj bitching about pep8, it's always something pep8 says no such fucking thing about. some knob over at intellj is just enforcing his favored code formatting style and parading it as being in the spec.

0

u/[deleted] Sep 23 '19

[deleted]

14

u/ythl Sep 23 '19

Is it an actual javac warning? Or just an IDE linting warning? I treat compiler warnings seriously. IDEs, whatever

2

u/t3hmau5 Sep 23 '19

Jetbrain's 500 warnings, none of consequence.

1

u/EishLekker Sep 24 '19

You didn't say you were talking about compiler warnings only originally.

7

u/EishLekker Sep 23 '19

And while you wait for that bug to be fixed, and your project to be able to upgrade to that version, you do what exactly? Put the whole project on ice because it doesn't compile because all warnings are equal to errors?

→ More replies (9)

11

u/slepnir Sep 23 '19

https://www.baeldung.com/java-suppresswarnings

Just make sure you add a comment to explain why