Justin du Coeur (jducoeur) wrote,
Justin du Coeur

There are moments when I *truly* hate Java

Okay, I've kind of accepted that String equality doesn't work the way I expect it to. But Integers?!?!?

I just lost over an hour trying to figure out why (effectively) this:

Integer creatorId = [the person who is trying to start a conversation]
Integer ownerId = [fetch the person who actually owns the flist you're trying to post to]
if (creatorId != ownerId) throw Exception(...);

was throwing when exceptions trying to post to my own flist.

Yes, yes -- it's all terribly consistent in how it deals with reference vs. value objects. But that consistency leads to an astonishing number of utterly idiotic and pointless bugs. C# may be less theoretically clean and elegant, but it tends to do what I intended when I wrote the damned code, *especially* in the way it treats values vs. references. It is very, very rare for me to want to compare boxed value objects by reference, so Java's insistence on using the obvious comparison operators that way is a real PITA.

Once again, Java's ivory-tower purity is irritating the heck out of me. Aaron just described it to me as "the anti-Perl", and that's quite fair -- but I prefer a middle ground that doesn't carry things to *either* extreme...
Tags: programming

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded