>> Perhaps such a decision to make it an error rather than a warning is justified, if indeed static analysis can prove rather than merely suggest that the code is unreachable. (Then again, Snafuist pointed out recently that unreachable code is a valid obfuscation technique.)
I don't know. It seems to me that this should just be a warning. Unreachable code can be useful sometimes for debugging purposes.
>> If you want a more friendlier forum for java, i would suggest Big Moose Saloon
I took a quick look at the site, and it does indeed look promising. Thanks.
>> This C++ elitism doesn't impress anybody, and only does a disservice to yourself.
To be fair, I was really only joking (the Jell-O brained Java programmers bit), but to some degree I do feel that C++ is clearly a superior language. Take a look ar Java generics:
The only way that this can "work" is if you specify the supertype in the declaration! The reason for all of this, of course, is because generics are compiled into bytecode (and reused via "type erasure"). But it still doesn't make sense. A more logical approach would be to either allow a dual facility where compile-time code could use the templates fully but run-time code could only use the more limited "type erasure" feature, or else provide full support with the aid of reflection or whatnot. Instead, the designers of the language chose a half-hearted and, frankly, dim-witted implementation. So while I agree that we probably shouldn't sit around and make fun of people (who could be just as talented as any other programmer), I reserve the right to have an "elitist" attitude with respect to the language itself.Code:public static < Type > void foo( Type data ) { Type ref = data, // OK copy = new Type( data ); // Error ref.bar( ); // Error ref.baz = 1024; // Error }
>> We do that all the time on this board.
True, but we usually reserve those sorts of responses for the truly ignorant questions.
>> That response usually comes after a question that doesn't make sense within the bounds of the language. Something like, "In C++, how do I call my destructor function?".
Just as a side note, there are some occasions where this is actually necessary (think: std::vector, for one).
>> My whole point was that language ........ing contests are silly enough without the insulting of an entire base of programmers. I've worked with outstanding Java developers and I've worked with C++ hacks. I don't draw any conclusion from that other than that there are good and bad programmers in the world, and all kinds in between. Language has little to do with it. Anyway, in my experience the smartest programmers are the ones who know how to use multiple tools well, and know when to use each.
Agreed.
>> "Java is C++ without the guns, knives, and clubs." -- James Gosling