Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Tuesday August 24, 2004
01:00 PM

Java Straw Men

[ #20542 ]

I was reading Top Reasons Why People Think Java Un-Cool - Debunked and I was trying to figure out why this article was so problematic. In short, it takes exception to Paul Graham's suggestion that great hackers don't use Java. Specifically, it went through various arguments against Java and attempted to debunk them. I'll list some of the arguments and my thoughts about them.

Java has considerably fewer surprises and prefers not to add complexity to the language for rarely used features ...

OK. How about complexity for commonly used features? Try printing the lines of a file.

try {
    FileInputStream fstream = new FileInputStream(args[0]);
    DataInputStream DataInputStream in = new DataInputStream(fstream);
    while (in.available() !=0) {
        System.out.println (in.readLine());
    }
    in.close();
}
catch (Exception e) {
    // ignore the bad exception handling, please :)
    System.err.println("File input error");
}

Why do I have to instantiate two objects of different classes to perform such a common task? This is poor Huffman encoding. Common tasks should have simple interfaces when possible.

Java has been considered slow for ages.

For the most part, I don't think this is a valid criticism. The author defends the speed of Java, but I think this is frequently a mistake. The better question to focus on is whether we are optimizing programmer or computer time? If it's the latter, Java is not the best choice (just as Perl isn't.) If it's the former, Java tends to have problems due to its verbosity, but it's still a heck of a lot better than C++ or C.

Swing disasters continue to give Java a bad name.

It's not fair to blame Java for a bad library. This is a foolish criticism.

Java is a strongly typed language therefore you have to tell the compiler exactly what you intend to use.

Err, this is a criticism? Wasn't performance also raised? Are people wanting dynamic typing and the performance of a strongly typed language? Commonly used languages are not going to fall into this category (though I believe there are some functional languages which can.)

Most of the above "criticisms" of Java fall flat. There are plenty of things to dislike about the language, but I can cherry pick problems with any language and make it look bad. Even venerable COBOL, with its lack of namespaces and lexical scoping was still used to build enterprise software. Blanket criticisms tend to make people look silly because it's not fair to consider what a language should provide outside of the context in which that language will be providing it. The problem domains of programmers and the problem domains of businesses are not identical. Until more programmers (and businesses) realize this, we're going to continue to hear silly arguments like these.

If great hackers don't use Java, I think it's they want to solve the problem, not create a huge framework to pull the latest headlines from an RSS feed. If great companies do use Java, it's because they want to solve a problem, not have their systems crash because people forgot to check whether or not they successfully opened that file. I still think great work can be done in Java so long as people understand the tradeoffs and accept them. If they fail at this they'll likely do suboptimal work.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • So I can't take credit, but he pointed out that this article didn't really address Paul Graham's points:

    In particular, Graham claims that terser languages are more powerful [paulgraham.com], because studies have shown that coders churn out a pretty constant number of lines per day, regardless of the programming language. Java is anything but terse.
    I could go on, particularly since the Sun JVM isn't open source, and Graham makes a point of claiming that Great Hackers prefer to use open source tools. I thin

  • Swing disasters continue to give Java a bad name.

    It's not fair to blame Java for a bad library. This is a foolish criticism.

    I don't entirely agree. One of the often cited reasons for using Java in the first place are the cross platform GUI libraries (SWT being the other). This is not a third party library - it's effectively a core library, made by the Java folks for the Java folks. If it sucks, then it taints Java as a whole, and might make you regret ever using Swing in the first place.

    My main p

    • By that argument, you can criticize Perl because, let's face it, though CGI.pm is incredibly useful and recommended, both the code and the interface leaves much to be desired (as Lincoln Stein readily admits.) There are plenty of other "core" modules -- made by the Perl folks for the Perl folks -- against which one could make a similar criticism. Whether or not these libraries are well designed has nothing to do with whether or not Perl is well designed.

      I do agree with your comments about the "Java ment

      • By that argument, you can criticize Perl because, let's face it, though CGI.pm is incredibly useful and recommended, both the code and the interface leaves much to be desired (as Lincoln Stein readily admits.) There are plenty of other "core" modules -- made by the Perl folks for the Perl folks -- against which one could make a similar criticism. Whether or not these libraries are well designed has nothing to do with whether or not Perl is well designed.

        If CGI.pm had sucked as badly as Swing supposedly d

  • Java is verbose, pushed by totally uncool corporate goons, and not open source. Duh. However, Graham's criticisms, while funny, are almost completely wrong. There are lots of good hackers using Java, and all you need to do to see this is look at the open source Java community. There is a willingness among them to admit that some problems are actually complex and are not best solved by writing three lines of code (often in a bizarre newly-invented syntax). I find this acknowledgement somewhat lacking am