Why Java Is Great

First, this is not going to be a LanguagePissingMatch, I hope this will be a genuine list of positive (and negative but constructive) comments about Java.

On JavaBandwagon, someone said: In short, Java is a great language, but there is a lot of hype and excitement from folks who don't understand why it's great.

So let's tell those folks in simple terms why its so great and why they like the language.

I'll kick this off with some trivial examples but there are many more experienced people than me that I hope will contribute with the more subtle points.

-- ChanningWalton

See also: FutureOfJava.

[Here is the current list of good and bad things]

Why Java is Great

Bad things (part of the language and library definition)

Note that there is also a list of JavaDesignFlaws.

Bad things (implementation issues that should get better) Bad things (part of the surrounding ethos)

C-lovers: Lisp lovers: PHP Lovers: Etc. Lovers:

Sun consistently use the same (rather large) set of buzzwords to promote Java:

"Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture neutral, portable, high-performance, multithreaded, dynamic language."

(The Mary Poppins of computer languages!)

When introducing Java to students I usually list the keywords, talk about "simple", "object-oriented", and "interpreted". I refer the students to Sun's overview for the blow-by-blow account of these buzzwords: http://java.sun.com/docs/overviews/java/java-overview-1.html


How do you feel Java lives up to that set of buzzwords ? -- ChanningWalton

Well, it all-but-unarguably lives up to object-oriented, network-savvy, interpreted, secure (at least relatively speaking), architecture neutral, and multithreaded. I think it's simple, but others disagree. It's more robust than C and C++, for sure. It's mostly portable, and while it's less dynamic than Smalltalk, Lisp, and the like, it's much more dynamic than the languages that the majority of programmers had been accustomed to. That leaves high-performance, which (at the time that set of buzzwords first appeared) Java definitely was not. I think it will get there, and it's making progress, but I still would only classify the performance as "acceptable for many jobs". -- GlennVanderburg

(Most of the students "got" the VM idea, garbage collection, interface-vs-classes, and reflection. Few of them took to the idea of exceptions. --)

Something is only portable if it has been ported. Sun (on its bid to become the EvilEmpire?) promoted Java as the first platform-independent language, which is patently false. First, Java is the platform (the virtual machine should be the tip off), and it needs the VM to be ported. That being said, it has been ported quite a bit, even though I haven't seen a fully compliant VM yet. Hmm.. sounds like ANSI/ISO C. Just trying to debunk some buzzwords.. -- SunirShah

I'd have liked Sun to release a text-only JDK (with an explicit subset of the full API). This would greatly improve the availability of ports. Besides, not everyone requires a GUI.

Could you clarify this for me some guy? Are you saying that you'd like Sun to release a Sub-Java that would be all of java but only the text only sorts of display methods? Would you like them to develop a special text only virtual machine standard? Are you looking for ports of the VM to systems that don't support GUIs or ports of text display software to java?

I ask, because as for the JDK itself, I haven't done anything GUI with it ... I'm still fighting with polymorphism ... I fumble with code using a text editor and I display stuff using text only functions like System.Out.println() .... -- EricHerman

With experience comes wisdom, Grasshopper. I am by no means a Java guru, but I was able to make a simple output GUI for a multi-threaded app, to display output from each thread in a separate window, in less than a day -- Pete Hardie

Sun wants to encourage Java ports. Some people don't need the GUI. If people porting the JVM (and the rest of the kit) didn't have to worry about the GUI, it would be much easier for porters to keep up with Sun's releases. Say I wanted to build a Linux based application server using current Java technology. Chances are I couldn't, because the Linux JVM porters are still busy fixing all that GUI code I don't need. Requiring two different JVM standards would be unfortunate though. --

Has anyone looked at Java 2 Micro Edition (J2ME)? I haven't. http://www.sun.com/consumer-embedded/cover/j2me.html

Yes I have and I downloaded the JBuilder "handheld express" tools which includes a simple PalmOS deployment tool and built a couple of simple apps myself. The available APIs are cut down (no floating point in the Math class for example, no AWT) but it appears you can build usable apps with it.

Ward asked me the question which I've repeated to everyone I talk to about Java: "What's good about Java?". Here are the typical responses:

One irritation I have with Java, partially discussed above, is that because I cannot declare that a class implements an interface, I am forced to do unnecessary cloning for safety's sake. Given an object with a date attribute, I am forced to write code like:

  public Date getDate() {
	return (Date)date.clone();

If I could declare that java.util.Date implemented an ImmutableDate? interface, I could write the method:

  public ImmutableDate? getDate() {
	return date;

I know that someone could do malicious casting, but I choose not to worry about that. Should I anyway?

See ValueObjectsShouldBeImmutable. -- EricJablow

It's typical that a page listing all the good things about Java becomes a focus for nit-picking criticism of Java. How about going through all the benefits list ed at the top of the page and seeing how other languages compare?

Or put another way. Say you were about to embark on a BareMetal? project with complex interaction of clients, servers, databases and legacy (contradiction there, I know). Why on earth would you use any language other than Java?

Because trying to integrate with legacy systems in java is painful.
Other languages compile down to native code and are therefore faster (C, Fortran, several implementations of Common Lisp), have better libraries (Smalltalk), are more expressive (Lisp, Prolog, Smalltalk), mind-expanding (Lisp, Scheme, Smalltalk Prolog, Haskell), extensible (Lisp, Smalltalk, C even) or smaller (just about everything). Java isn't even interactive. You have to define a class, then compile it, before you can run it. There are lots of reasons not to use Java.

When you talk about complex interaction, you should bear in mind that "Perfection is attained, not when there is nothing more to add, but when there is nothing more to take away.", and "Complexity is the hallmark of stupidity."

These criticisms are being expressed, not because people think that Java is on a par with Intercal. They are being expressed because of the constant hype, and because other, better languages are being overlooked. Java advocates should be more modest about their favourite language. They have much to be modest about. -- DonaldFisk

-->> Why Java is all but great:

But after all it's true it's a cool language if you dont care about programming.

[Some good points, but it's more rant than rational critique and is lacking any proper references, which severely diminishes the credibility of the commentary. Some of the above is obsolete, such as the suggestions that Java is closed source. It reads like it was written by a technically weak but tolerably-engaged ComputerScience student -- his or her first language, no doubt, is C/C++ -- who is expressing his/her irritation at being forced to learn Java to complete a (say) 6CC097 Multi-Platform Distributed Systems assignment and has left it to the night before the deadline. I award the rant a grade of 'D'.]

What you say about my post is largely true =), even if i dont agree on everything.

In particular, about the ready-made code. I didnt mean to say "Do it all yourself", wich is certainly impossible. What i was pointing out is that trying to come up with your solution is the only way to learn how things works; possibly making them better. This way you can understand what you use, and find if the library's code really fit your need. So IMHO Java is not a great language to start with. One important thing i forgot to mention (but that's may be just me), is the machine model behind the language. IMO, a language must give you a clear machine model through its structure so you can understand the language/machine interactions. I find it particularly lacking in OO languages (not just Java), because of the difference between the language philosophy and the way a computer actually works. OO is certainly great for programm's conceptions, but can't replace what a low level procedural language can teach you about the actual machine you work on, like C, wich machine model is great (portability). (On this topic, for those interested, i'd like to also mention "Assembly Language Step bu Step" -Jeff Duntemann). This said, i admit i have been unfair with Java. What upset me is Java's marketing rather than the language itself. And you guessed right, im a CS student. I'll try harder on commitment and technic, thanks for suggesting. Cheers.

[EditHint: Move criticisms to JavaCriticisms]
See also: JavaIsTheNewCobol, WhenShouldWeUseJava, WhenShouldntWeUseJava


View edit of November 21, 2013 or FindPage with title or text search