Hacker News new | ask | show | jobs
by dehrmann 2534 days ago
That still doesn't explain Java's popularity as a backend language. Unless J2ME or Applets was the killer app.
9 comments

Yes, applets looked promising, but server-side, you might say Java was the Node.js of its time. Back in the early dot-com era, we were looking for a way for inexperienced programmers (us) to do Internet programming easily, and with its built-in threads and easy-to-use network libraries, Java looked pretty good. (And where it wasn't good yet, we thought Sun would improve it.)

This is around the time when Apache was popular with its original process-based concurrency model. You could waste a lot of memory running mod_perl with a pool of a hundred processes.

Java performance was pretty bad compared to C, but writing a select-based C server looked convoluted, and using threads in C looked obscure, non-portable, and bug-prone. We wanted a friendlier language than that.

I would say cross platform apps, and an 'alternative to C/C++' was Java's killer app. Popularity as a backend language comes as a side effect of its general popularity (a la Node w/ Javascript, though there's something to be said about Node's 'different' approach)
> alternative to C/C++

Safety and garbage collection.

In very practical terms, dependably obtaining a stack trace that says "NullPointerException" or the like instead of silent and intermittent memory corruption was more than enough to attract shell-shocked C and C++ programmers.
This. Also the libraries - in 1994 c++ toolkits were very poor - I was there, it was terrible - the Java libraries and in particular AWT were just fantastic. Basically features and deliveries that required weeks of heartache and grind could be delivered in hours.
Java features that have yet to show up in other languages: Scalability - both horizontal and vertical. Memory utilization (you can have humongous heaps without having to worry about managing all that memory). Managability - easy to "divide and conquer": you can plop a jar and start using it right away. Something that's practically impossible in other languages. Third party ecosystem (both free/oss and paid). Speed. Java is one of the fastest managed languages.

Yes it is verbose, yes inexperienced developers do the wrong things, but it does a great job preventing you shooting yourself in the foot, and most importantly, once you have a stable codebase, it can keep running for months/years.

> you can plop a jar and start using it right away

I'm mostly a Java developer, so I think this explains why Docker always looked a little silly to me. I also write some Python, and once I have to set up a virtualenv, that's when Docker's existence makes more sense.

Erlang/BEAM has all that (and does it better)
Enterprise -> Java + XML

They got in early, largely split the market with .NET

I think Java was unique as it was the first language with a major corporation behind it and a large marketing campaign.
That was COBOL with Univac, IBM and Honeywell.
Single platform (OS360 / zSeries/zOS).

Java is (famously) multi-platform. As disputed by Sun and Microsoft.

What about VisualBasic, for example? Or ObjectPascal/Delphi. Or Objective-C.
Objective C didn't have a major corporation behind it until 2006-2009. Apple wasn't really relevant (outside the iPod/iTunes) until OS X gained traction and the iPhone (and app store) came out.
Apple was not a major corporation in 2000? (But it's true that would be post-Java.) Then neither was Sun. (Or maybe FigBug meant IBM which pushed Java heavily a few years later? They also pushed Smalltalk before, by the way.)
In 1994 Apple was about to go insolvent after failing multiple times to create a next generation OS, and spending the remaing money acquiring NeXT, which happened to be a reverse acquisition in the end.
What do you consider a major corporation? In (fiscal year) 1997 when it merged with Next and started to push objective-c the company had $7bn in revenue (down from $11bn a couple of years before, that’s true) and more than 8000 employees. The next couple of years sales were around $6bn but increased to $8bn in 2000.
Also, to add to what everyone else is saying, you have to remember (or try to imagine) what it was like back then. When Java first came out it was hella cool! (Like MTV.)
Java was super heavily marketed
Java has good concurrency support and scales well.
Applets were the lever which propelled Java to a popular mainstream language.