Archive for the ‘Java’ Category

Java compiler cares about you

Sunday, August 15th, 2010

There is an old anecdote, or something like a quote, which goes something like

– I really love the Java compiler, it cares so much about me
– how come?
– Well every time there is an error, it’s like “Aww, you have an error here and here, a warning here, but I can fix that by adding this and this. Here, have a cookie, sweetheart! Also I optimized these classes for you and now everything works 2 times faster”
– while vc++ compiler is like “ARGGHH! you stupid human, there is some error in those 150 files. And I don’t like the way you placed your comments here, REWRITE EVERYTHING!!! ARGHH!!!”.

It certainly seems a little like that, especially now that I’ve noticed really how much java compiler is with you even while you are coding.

1. it warns about something
2. it adds an automatic option to fix that, or even add a suppress warning
3. BUT! if you have added that suppress warning header, and there are no warnings anymore, It will warn you about having an unnecessary warning (!).
Observe: “Unnecessary @SuppressWarnings(“unused”)”.

It’s watching your every move…