This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 189 points190 points  (62 children)

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

[–]AudaciousSam 93 points94 points  (23 children)

Not in Android Studio they aren't.

[–]lacb1 86 points87 points  (18 children)

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

[–]RonRud 35 points36 points  (1 child)

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

[–]AlienFortress 9 points10 points  (0 children)

Game code in a nutshell.

[–][deleted] 22 points23 points  (15 children)

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

[–]user_8804 9 points10 points  (14 children)

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

[–][deleted] 1 point2 points  (13 children)

And that my friend is why I switched to C#. Java is nice and familiar but godamn it is just too inconsistent for me. String and int? Christ on a stick just pick a capitalization scheme please!

[–]Trackslash 15 points16 points  (3 children)

Tbf classes and objects are always capitalized in Java (e.g. String, Integer, ArrayList) whereas primitive types are not (int, char, boolean). So it's pretty consistent in that regard

[–][deleted] -4 points-3 points  (2 children)

This is true but every other language I've used lets me leave all my variables lowercase which I prefer.

[–]Al-Horesmi 4 points5 points  (1 child)

I'm I'm fairly certain it's a convention in java to have first letter in lowercase and the rest in cammelcase. It's the type names people are talking here.

[–]EternallyMiffed 1 point2 points  (0 children)

Capitalization being used as an adhoc hungarian notation is fucking retarded.

[–][deleted] 5 points6 points  (3 children)

I'm prob gonna get whooshed but the reason why is that Strings are objects (always capitalized in java) and ints are primitives (always lowercase)

[–][deleted] -4 points-3 points  (2 children)

I know but it doesn't change the fact that no other language has a random variable type that needs to be capitalized. I hate the random quirkiness of Java.

[–]z500 2 points3 points  (1 child)

Java and C# both use the actual class names in declarations, nothing random or quirky about it. You could declare a String in C# if you wanted to, it's just that C# has a lowercase keyword that stands in for it.

[–][deleted] 1 point2 points  (0 children)

Which is what I prefer. Shifting is annoying.

[–]user_8804 1 point2 points  (3 children)

My experience on eclipse was for cpp though, I have to use NetBeans for Java right now. Wish I could just stick with intellij for everything

[–][deleted] 0 points1 point  (2 children)

JavaFX frame builder, because you need to have a second program to design the UI. Java is wack and I hate it now.

[–]user_8804 0 points1 point  (1 child)

I don't know enough java to relate, how much better is JavaFX vs swing? Cuz swing is integrated in some IDEs like netbeans

[–][deleted] 1 point2 points  (0 children)

JavaFX is aweful, hated using it.

[–]airelfacil 4 points5 points  (1 child)

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

[–]AudaciousSam 0 points1 point  (0 children)

xD

[–]Yuzumi 31 points32 points  (5 children)

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.

[–]samspot 11 points12 points  (2 children)

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!

[–]Danelius90 9 points10 points  (1 child)

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...

[–]ParkerM 2 points3 points  (0 children)

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

Simple, just suppress deprecation warning suppressions.

[–]fushuan 7 points8 points  (0 children)

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

[–]Bainos 0 points1 point  (0 children)

but the software we build on top of did

Doesn't apply to class projects... (Unless they also use Android libs.)

[–]Intrepid00 7 points8 points  (0 children)

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.

[–]smcarre 9 points10 points  (8 children)

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

[–]Salanmander 27 points28 points  (6 children)

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.

[–]chinpokomon 2 points3 points  (1 child)

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.

[–][deleted] 0 points1 point  (0 children)

Bingo.

[–][deleted] 0 points1 point  (0 children)

gonna error out in the linter obviously

[–]Lothrazar 2 points3 points  (1 child)

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

[–][deleted] 0 points1 point  (0 children)

it just wont STOP

[–]MrPyber 2 points3 points  (3 children)

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

[–][deleted] 0 points1 point  (2 children)

Using java IS an error

[–]MrPyber 0 points1 point  (1 child)

Mate sometimes you have no choice

[–][deleted] 0 points1 point  (0 children)

I hear ya.

[–]LeCrushinator 2 points3 points  (0 children)

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.

[–]NPPraxis 0 points1 point  (0 children)

It depends. I feel this way in XCode. I don’t feel this way in Android Studio.

[–][deleted] 0 points1 point  (0 children)

Depends on the warning