BIGREDSWITCH Push it. You know you want to.

The Good and the Bad

I think that one statement demonstrates what’s good and bad about Java (the language):

int x = ...
if (x) ...

Of course this doesn’t compile in Java because the variable x does not evaluate to a boolean.

Supporters will state something like, duh — only booleans can be used as conditions; this is
consistent and explicit, and this type of implicit casting leads to errors.

My thought is: yeah, you guys are right; managers love this and it’s easier to teach students; but … sigh … nevermind.


No Comments Yet


There are no comments yet. You could be the first!

Leave a Comment

OSGi Smackdown Gone Shopping