Java Leads To Great Libraries

Tim Bray wrote Having Done Java about how writing Java leads to better quality libraries. Needless to say, I disagree. I originally sent this by mail to Tim Bray, but I don’t think that there’s any reason to not publish it here as well.

I’m afraid that I’m going to have to disagree with you on this one. I’ve relatively little experience with Java, but I have been called upon to do some web things. And the standard library makes very, very angry when compared to CPAN[1]. There are a couple of aspects to this:

  • Firstly, everything seems to have been vastly overengineered. Simplicity got thrown out of the window from what I can see. I blogged about one incident (PUTting an URL), but there have been others, frequently involving the bizarre servlets API.
  • Secondly, the strong type system leads to weirdness. This isn’t necessarily Java’s fault, more the people who use it seeing no other way to do things. Again, I’m forced to compare with Perl here. I’m
    thinking in particular of, which happily handles https, and http URLs. However, they’re completely different classes in Java. And if you try to feed in one to a method which expects the other, it’s no-go.

Ok, I’ll give in. I’m less moaning about the quality as to the bizarre design which I perceive. But it certainly feels like it should be a factor in any discussion of quality (nebulous as that might be).

1 I’ll admit, however, that there is a huge amount of crap in CPAN too. Anybody remember