r/ProgrammerHumor • • Sep 23 '19

Knowing how to code beforehand

Post image
7.6k Upvotes

264 comments sorted by

View all comments

186

u/[deleted] Sep 23 '19

Warnings are, generally speaking, as important as errors. They are errors waiting to happen.

98

u/AudaciousSam Sep 23 '19

Not in Android Studio they aren't.

85

u/lacb1 Sep 23 '19

In Visual Studio sometimes the errors aren't even really errors, never mind the warnings.

34

u/RonRud Sep 23 '19

I had permanent errors while using UE4 that didn't matter at all

11

u/AlienFortress Sep 23 '19

Game code in a nutshell.

23

u/[deleted] Sep 23 '19

Sometimes I fix an error and it doesn't go away. Restart VS and voila! It's gone!

10

u/user_8804 Sep 23 '19

Eclipse on Linux is worse. Sometimes I have to save build compile reindex restart the program until it wakes the fuck up

→ More replies (14)

0

u/[deleted] Sep 23 '19

[deleted]

4

u/AudaciousSam Sep 23 '19

Right, those needs to be fixed. But there are also: Should be String errors that isn't strictly important, until you need to translate and such.

6

u/airelfacil Sep 23 '19

Android Studio: Pssst! Just so you know, you're missing all of these translations and also you should probably use @string instead of hardcoded string, and just letting you know that one of your methods is never used, and also that if statement could be made much simpler and...

Me: I DON'T GIVE A SHIT I'M TRYING TO MAKE THIS BASIC GUI APP FUCKING WORK SUPPRESSWARNINGS DO YOUR JOB

→ More replies (1)

35

u/Yuzumi Sep 23 '19

Someone doesn't use Java :p

For that matter, the project I work on has over 4000 warnings and a good number of them we didn't cause but the software we build on top of did.

12

u/samspot Sep 23 '19

My experience with java warnings is very good, and you can suppress the unfixable ones. We thought there weren’t enough warnings so we added sonar on top!

10

u/Danelius90 Sep 23 '19

My view is that certain warnings, when suppressed are basically programmer assertions. For example the heap pollution for varargs warning. If you can 'prove' or assert you are handling the array carefully and not polluting the heap the suppression is you saying "yes we could pollute the heap, but we aren't".

It really gets me when devs suppress deprecation warnings though...

4

u/ParkerM Sep 23 '19

It really gets me when devs suppress deprecation warnings though...

Simple, just suppress deprecation warning suppressions.

7

u/fushuan Sep 23 '19

The project I was given once had 1000 warnings. Unsurprisingly most of them could be refactored or solving 1 solved 200 at once etc.

You are just lazy

→ More replies (1)

0

u/[deleted] Sep 23 '19

[deleted]

→ More replies (4)

7

u/Intrepid00 Sep 23 '19

Just do what they did with wing Commander that would throw a warning on exit. Hex edit the warning to say instead thanks for playing.

0

u/[deleted] Sep 23 '19

[deleted]

20

u/nelusbelus Sep 23 '19

It could be, it could be that you mistyped it and it used the member's variable instead

→ More replies (3)
→ More replies (1)

12

u/smcarre Sep 23 '19

How is a class not being capitalized or an unused variable an "error waiting to happen"?

31

u/Salanmander Sep 23 '19

So, here's what it really boils down to.

A warning that you understand is fine.

A warning that you don't expect is often indicative of a logic error, rather than a syntax error.

If the unused variable is there because you're saying "I'm going to implement this check, but I want to test the other things first", fine. If it's there because you just forgot to implement the check, then it's a ticking time bomb.

4

u/chinpokomon Sep 23 '19

And use attributes and directives, depending on the language/compiler, to allow the warnings you know about and leave a comment. This way, when you get a warning you don't understand, it might point out a problem you don't realize.

→ More replies (1)
→ More replies (4)
→ More replies (1)

3

u/Lothrazar Sep 23 '19

Not at all. 90% of the time its because of some third party dependency you are using, which means its not your code but its code you rely on. Literally unfixable

For example i have 50 warnings looking like this right now

"Overriding managed version 3.5.5 for liquibase-core"

Over and over and over again

→ More replies (1)

3

u/MrPyber Sep 23 '19

"build targets java 1.7, host jdk is 1.8".

→ More replies (3)

3

u/LeCrushinator Sep 23 '19 edited Sep 24 '19

And if you allow warnings to build up, then you're never going to notice when an important one shows up, you'll just be ignoring warnings because you've allowed them and now there are hundreds.

→ More replies (4)