Some of its design choices have fallen out of favour in recent times—I still disagree with their elision of unsigned integers—but they're generally at least defensible.
Java took off because it offered developers a path out of serfdom to Microsoft, at a time before the smartphone era somewhat reduced their market power. Once it had enough users to benefit from network effects, its future was assured. It took Sun putting billions of dollars into promoting and supporting it to get there.
Sun's commitment to Java probably killed the company, in the end.
There were better-designed languages at the time, and there have been plenty of much better-designed languages since, that have or will fail to displace it. Rust might be counted among these.
Can you give some examples of parts that are not well designed?
class Animal {} class Cat extends Animal {} class Dog extends Animal {}
Animal[] cats = new Cat[1]; Animal dog = new Dog(); cats[0] = dog;
This will compile fine but throw an error at runtime. The only possible way to avoid runtime errors with assigning a Cat array to an Animal array is if you only put Cats in it, at which point it would make more sense to just use a Cat array, so it would have been better design to make assigning a Cat array to an Animal array a compiler error.
Animal[] a = new Animal[2];
a[0] = new Dog();
a[1] = new Cat();
If you can upcast Cat to Animal, why can Cat[] not be converted to Animal[] in the same way?If you could make sure the array is read-only (which you can't, in Java), it would make sense to say that "Cat[]" is a subclass of "Animal[]".
The problem happens when you write. "Animal[]" means that you can put any kind of animal (not just Cat) into the array; and this is not true about "Cat[]"; therefore, "Cat[]" shouldn't be a subclass of "Animal[]".
Unfortunately, Java treats "Cat[]" as a subclass of "Animal[]", and then runtime errors can happen when you write to the array. And because of backwards compatibility, this problem is not going to go away.
Later they got it right with generics. "List<Cat>" is not a subclass of "List<Animal>". (But both of them are subclasses of "List<? extend Animal>", which means: a read-only list of Animals.)
Basically, because it's not type safe (for the reason I gave above). It doesn't really help expressivity to be able to assign a Cat[] to an Animal[], but as you can only use it safely if you only put cats in it, so you might as well just make the variable Cat[] instead of Animal[]. See the section on arrays in this wikipedia article: https://en.wikipedia.org/wiki/Covariance_and_contravariance_...
Java made it possible for average engineers to turn out relatively reliable applications, in a fraction of the time it'd have taken them with any other option (apart from Smalltalk but it was already niche by then).
Wouldn't this be Lisp?
> And you're right: we were not out to win over the Lisp programmers; we were after the C++ programmers. We managed to drag a lot of them about halfway to Lisp. Aren't you happy?
* https://people.csail.mit.edu/gregs/ll1-discuss-archive-html/...
A follow-up noted:
> Yes! Java broke C++'s monopoly, and now C# is breaking Java's, and this sequence of broken monopolies dispelled the belief that have to use "the standard language", and now I code in Python for a living.
[1] https://en.wikipedia.org/wiki/Guy_L._Steele_Jr%2e
Steele is/was well-acquainted with the bad parts of Java—he helped design Scheme after all. But in the alternative timeline where Java was not created, Java (and other machine-independent runtimes) would have not have become popular, and everyone would still be statically compiling C++.
I don’t know if that’s actually true. Computers were getting more and more powerful in the 90s, and hence more capable of supporting memory-managed and dynamic languages. Had Java not existed, I think that there’d be a very good change that Smalltalk or Lisp would have taken off instead. Indeed, looking at the late 90s, I think that there’s a good chance that the world would have gone with Smalltalk, and the computing industry would actually be light years ahead of where we are now.
Not more than stallman though. Nowhere close to stallman.
> I think he deserves better than this narrow, one-sided libel.
Richard Stallman has contributed more to humanity than the overwhelming majority of people who have ever lived - including gosling. I think he deserves better than this narrow, one-sided libel. See how that goes. Or how about we let people have their say? Regardless of how much they contributed to humanity.