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.
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 think frantic defensive articles regarding Java aren't helping anyone. The managers that choose Java don't read Paul Graham articles, and I doubt Paul Graham much cares what a Java-oriented business journal has to say about his articles. Please note that I am just relating the opinions that Graham has put on his website. I do not necessarily share his views
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.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.
My main problem with Java is not the language itself, but what I call the "Java mentality". The "more is more" philosophy, and the idiotic notion that Java must be a better language because, well, it has corporate sponsorship and strong typing.
Re:On Java
Ovid on 2004-08-25T00:55:01
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 mentality," but I've talked to plenty of Perl hackers who so ardently defend Perl that they refuse to acknowledge its limitations (I used to be one.) Heck, anyone can read the beginning of the Apocalypses and see that Larry agrees with many of these criticisms though he's quite eloquent in pointing out the things that Perl has done right, too.
Re:On Java
djberg96 on 2004-08-25T04:29:16
If CGI.pm had sucked as badly as Swing supposedly does, then I think you *would* have seen a lot more "Perl sucks" out there than you did. As it is, CGI.pm is tolerable and was probably better than anything else that was around in, say, 1996 (though I'm guessing).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.This is mostly a psychological distinction (which is why I said I don't entirely agree, but I don't entirely disagree, either). I don't associate CGI as strongly with Perl as I do Swing with Java. I'm trying to figure out, as I write this, why this is. I have some ideas but it's hard putting them into words. Perhaps it's because the Java folks, and Sun in general, hype their libraries so much that Java the language and the Java libraries are inexorably intertwined in many people's minds. Whereas any fool can write their own CGI module if they don't like the one that's out there. Perhaps this ties back into open source some way.
Well, I'm rambling now. Time for bed.
:)
Re:it's actually fairly simple
chromatic on 2004-09-04T05:28:15
Are you suggesting that when all you have is Lisp, every problem requires you to invent a hammer?