top | item 8090580

Ask HN: Why does the enterprise have such a strong affinity to Java?

45 points| fizwhiz | 11 years ago

I'm trying to get a deeper understanding of how Java actually exploded into the mainstream "enterprise" and has continued to do so at least since the early 2000s. As a regular browser of HN, I've stumbled upon different flavors of commentary related to this in an ad-hoc fashion; some snarky like "Oh you know, it's a dumb-proof language that really doesn't require people to have had a solid foundation in CS so hiring and ramp-up are easier" and some more insightful like "It's not really Java the language, but Java the ecosystem (like JEE) and particularly the JVM that makes it an attractive proposition for enterprise companies". I'm wondering how much of this proliferation can be attributed to:

1. Features. Core functionality that the language/ecosystem provides like the JVM, portability, relative ease in multi-threaded programming, garbage collection etc) 2. Timing. Was there a specific problem during the late 90s or early 2000s that was a sweet spot for solving using Java? Seeing that this was around the time when the internet really became mainstream, was Java primed to benefit from this in a way that set it apart from the then-contemporary programming ecosytems? 3. Scalability. In terms of the number of people you can hire while "growing" your company; could the popularity of SOA/WebServices fueled this as well?

Disclaimer: I'm not generalizing that every "big" company uses Java and I'm not saying that the ones that do are obviously doing it for the right reasons; I'm purely looking at this from academic interest since there's so much rich nuanced history that I feel I don't understand. Such a discussion could be easily extended to ask "What does this mean for functional programming languages based on the JVM like Clojure and Scala". Like Mark Twain said: "History may not repeat itself, but it certainly rhymes."

64 comments

order
[+] mindcrime|11 years ago|reply
Java got a couple of very important things right, at just the right time. And it tapped into some trendy / buzzwordy things at just the right time.

On the first point:

1. binary object compatibility. This was huge in a day when C++ and most other "cross platform" languages required you to ship libraries as source code, which bloated your code base and slowed down your compile times even further. Java nailed "library driven development" at a time when people were hungry for that.

2. Threading. Java's threading model is far from perfect, but it made using threads far more accessible, especially in a cross platform way, than what was previously possible in languages like C++ - especially while staying within the bounds of the language / standard library itself.

3. Garbage Collection - has it's pluses and minuses like everything, but a lot of C++ people who were tired of goofing around with manual memory management really embraced Java and it's simpler approach.

On point two above:

1. "Internet" programming. Java had good support for sockets and even basic HTTP stuff early on, and always seemed to do a decent to better-than-average job of supporting network programming (with a couple of glaring exceptions, like raw sockets)

2. "mobile code" - most people never wound up doing much with this, but it was trendy in the late 90's, early 2000's and Java was seen as a good platform for doing this stuff.

And probably some other stuff I'm forgetting. All in all, Java just did a nice job of hitting a good "sweet spot" at a good time and place. And that sweet spot was sweet enough to make it compelling, despite its warts.

[+] zmmmmm|11 years ago|reply
You should probably ask the question in reverse: why is Java seemingly so heavily criticised on HN when it is clearly an incredibly successful and productive platform that almost took over the whole enterprise world?

For its time Java was a god send. It solved a ridiculous number of problems that programmers today just don't even think about. We used worry about things like byte order when sending data between computers. We used to license libraries to provide basic things like lists, hashtables, string handling. Compiling things to work on multiple platforms was a nightmare, especially Windows. Developing on Windows and deploying on Unix was a pipedream. Java just swept all of this away and replaced it with a standard portable runtime that worked across Windows and Unix was free. The equivalents that offered these things (say, Perl) were not considered viable contenders at the time (dynamic languages in general did not gain a lot of trust until Ruby on Rails and PHP became so widely used - people just did not believe that you could build a large scale system with such languages and not have all fall apart if the type system wasn't rigorously checked).

[+] jimmaswell|11 years ago|reply
>We used worry about things like byte order when sending data between computers

Isn't it always just in network order?

[+] btilly|11 years ago|reply
Java was marketed in the 1990s as a cross-platform language that was basically a better version of C++ for use on the web. Of the languages that were associated with the early web, Java was the only one with large corporate support. (Contrast to the then-dominant web language, Perl. And consider that the phrase "open source" had not yet been coined.) First from Sun, and then from other companies like IBM and Oracle that feared an all Microsoft future.

Thanks to the corporate support that went into it, Java built strong ecosystems in a number of areas. The viability of multiple strong corporate supporters made it a safe choice for any enterprise that wanted an option that was tied to the web which wasn't tied to Microsoft. This gave them a base that it never lost.

It is worth noting that Microsoft took note of this competitor, and did their standard "embrace, extend, extinguish" approach. However they got sued by Sun for adding Windows only extensions, and after they lost that, Sun was able to ensure continued consistency.

Random note. Java is far from the first portable cross-platform language to be marketed on that basis. See COBOL.

Random amusing note. While Java was marketed as being cross-platform, it used threading in a way that Solaris was designed for and competing Unix systems were not. I've never considered it coincidence that Solaris wound up soundly beating the other Unix systems in "portable Java benchmarks" and that was when it became the dominant version of Unix.

[+] eddieroger|11 years ago|reply
The impact of corporate support can't be understated. Corporations love to buy support, meaning, have someone they can blame when things go awry, and charge if they're not fixed on time. Usually, it's little more than a security blanket, but that blanket helps the C-levels sleep at night.
[+] kyllo|11 years ago|reply
Random note. Java is far from the first portable cross-platform language to be marketed on that basis. See COBOL.

Yes, and that's why COBOL was the last big enterprise language. Java is the new COBOL. A lot of corporations hung onto COBOL through the 80s and early 90s, skipping the C/C++ wave, and going straight to Java.

[+] fizwhiz|11 years ago|reply
>> It is worth noting that Microsoft took note of this competitor, and did their standard "embrace, extend, extinguish" approach

That was gold. Thank you for that.

Based on your answer, seems like there was an extremely close alliance between the big corps (sans MSFT) and the early Java dev team; I'm tempted to think that the creators (Gosling et al) could have taken cues from Java's corporate supporters to factor in designs that help address problems that those companies were facing. This really helps tie in how the Java "ecosystem" came to being because right from the beginning it seems like it was trying to solve "enterprisey" problems. Is that a fair assumption?

[+] adamnemecek|11 years ago|reply
Can you talk more about Solaris threading and how it was leveraged by the JVM? I'm interested. Or if you have a link.
[+] taylodl|11 years ago|reply
IBM adopted Java early on as a client side development technology to be used in client/server computing that was so prevalent in the 90s. IBM also had a lot of their customers rebuilding 20-30 year old applications in Java to address Y2K issues. IBM supports Java running on their zSeries and pSeries systems. IBM supports Java applications using JMS over MQSeries to interoperate with legacy applications and supports Java accessing DB2 databases. IBM even has tools to allow COBOL copybooks to be exposed as web services, which Java can then easily consume. There's still a ton of legacy COBOL applications and thanks to IBM, Java can interoperate with that legacy code and extend its functionality.

And it's not all about IBM either. Obviously Oracle, another enterprise favorite, is playing in the Java space these days and provide an application server, WebLogic, along with great support for accessing Oracle's RDBMs from Java. Oracle also has several industry vertical solutions all based on Java.

Finally there's Red Hat. Lots of enterprises run RHEL when running a Linux server and their JBoss application server is highly regarded.

Java then offers enterprises a lot of flexibility. There's multiple vendors from which they can choose to procure application servers, there's little risk of platform lock-in, they can fully interoperate with legacy applications and there's a ton of reasonable cost developers available - who are mostly happy with a language that's fairly modern. There's actually quite a bit for an enterprise to like about Java.

[+] filmgirlcw|11 years ago|reply
Great point about the y2k but. My aunt was a systems engineer at CSX and was one of the people that led their Y2K group (partially because she was one of the only people they had employed that was still expertly proficient in COBOL) and a lot of what she did, in addition to fixing the COBOL bits, was rewrite stuff in Java and build out Java connectors.

It's funny, I remember learning J++ in 1998 when I was like 15, around the same time she was knee-deep in the y2k thing. And we would email an call one another commiserating, because she was learning Java too (albeit at a much higher level and with real stakes).

As shitty as Java is for a lot of things, it is a godsend for dealing with legacy apps and code. And the thing is, those legacy systems are some of the most important systems around (banking, transpiration, health care records, major utilities like water and power, etc).

If I ever need to give myself nightmares, I just start to contemplate the infrastructure of our most important entities.

[+] pekk|11 years ago|reply
We could pretend that this is all about the incredibly unique properties of Java and "what it got right." But that isn't really true. It's just wrong to frame the question as "what was special about Java" let alone "what can I do with language x to duplicate its success?"

As of today, the reason is it's old and established and a safe choice, everyone knows about it, and everyone else uses it, and so many people write it, and there's so much existing code in it. Even if it sucks for some purpose, that's what you pay Java developers for.

The story of how it got there is again not about the incredible unique properties of Java but about the decisions of large companies in the contexts of the 90s, both in adopting and contributing to the development of Java.

Those decisions had a broad political and business context, and insofar as they had anything to do with the language itself that would have been in comparison to what were perceived to be the serious languages of the time, like COBOL or C++.

[+] andor|11 years ago|reply
I found this comment very insightful. It may not fit everybody's worldview, but that's no reason to downvote, right?
[+] techdebt5112|11 years ago|reply
I can give you some sense of why I use Java and enjoy it today in an "enterprise" setting. The JVM is excellent. Java 8 in particular is quite fun to use, streams in particular. The tool support isn't quite there yet for all of Java 8, however. In recent versions the concurrency APIs are quite diverse and easy to use (as much as multithreaded programming can be). There are also lots of good libraries -- Guava, Guice, and jOOQ to name a few. Java is also quite fast -- it's consistently outperformed by C and C++ but it's still competitive and much easier to write.
[+] AndrewDucker|11 years ago|reply
Faster than Python

Easier to avoid mistakes than C/C++

Easy to break into component parts that can be maintained separately

Don't have to worry about handling memory

Works the same on Windows, Linux, X86, ARM, etc. so your developers can be working on OS X and deploying on BSD for all you care

Static typing (remarkably important when you've got a team of 30 working on a large codebase)

[+] islon|11 years ago|reply
The "it's impossible/unmaintainable to develop a huge/enterprise codebase in a dynamically typed language" meme is really sad here on HN, specially for some one who works/maintains a huge/enterprise codebase in a dynamically typed language with a big team and have no problems at all.

Anyway I agree static typing was a big plus for java for the sole reason many people believe dynamic languages are just for scripts and small hacks.

[+] judk|11 years ago|reply
Team of 30? Team of 3000!
[+] charlieflowers|11 years ago|reply
Everyone seems to have covered the "dumbed down language" perspective. And there's definitely truth to that. Enterprises hire tons of developers, but Enterprises are terrible at determining which candidates are good developers. So there are a lot of mediocre ones.

However, there is another side of the coin that must be acknowledged. When Java came out, there was no Python or Ruby. Java let you be enormously more productive than C++ for apps for which garbage collection was fine. The VM offered features which weren't common, like reflection. Of course, Java came with a huge library. Java was a great option for a JFDI (Just Fucking Do It) language, and there weren't a lot of other options back then.

This doesn't solve the whole mystery. Why didn't SmallTalk or some other options that were available at the time do better? I don't really know. Java just took off like a rocket, in the same way that pet rocks and hula hoops did. There were some good reasons, but those reasons can't explain the whole phenomenon. And now, after that adoption tsunami is complete, Java is the safe, established (but boring, mediocre) answer that Enterprises like.

[+] chromatic|11 years ago|reply
Why didn't SmallTalk or some other options that were available at the time do better?

Smalltalk was expensive (VisualAge, VisualWorks, for example) and wanted to own the world (image-based). With the web suddenly solving all deployment problems everywhere (at least, that was the rhetoric), paying thousands of dollars per developer for tools seemed silly.

[+] charlieflowers|11 years ago|reply
Sigh. I thought it would be obvious to people that I was speaking of traction. Ruby and Python were not viable Enterprise options back then. And even if someone claims they were, they did not have that perception.

Yes, I could've been more precise in my wording. But a lot of people could be less pedantic too. I already interact with a compiler all day long. Didn't think I was talking to a bunch of compilers here too.

[+] icebraining|11 years ago|reply
When Java came out, there was no Python or Ruby.

Python is four years older than Java. When the latter was released, Python was already at 1.0.

[+] spullara|11 years ago|reply
Both Python (1991) and Ruby (1995) existed at the same time Java (1995) was coming to the market.
[+] no_future|11 years ago|reply
Lies. Python and Ruby are older/as old as Java.
[+] sz4kerto|11 years ago|reply
- it is stable (both the language spec and the JVM) - new versions are backward-compatible - the language is simple therefore easy task are easy (junior devs can slowly get up to speed) - it still has a lot of momentum (momentum = a new corporate project is easy to start in Java) - there's been a lot of experience accumulated throughout the last two decades

All in all, it's good enough and it does not really have any glaring flaws.

[+] zorked|11 years ago|reply
People are overrating language features I believe. The thing Sun did really well was marketing. They didn't go only to the core "tech" people in the enterprise: they reached _everybody_, and made it look like every company had to "move" to Java because it was the "future" even if few people understood what it was. Soon there were CEOs and CFOs and whatever talking on Bloomberg (or whatever) about how they were "moving" to Java.

For whatever reason IBM also jumped on that ship, and Oracle, and HP, and even Microsoft (albeit reluctantly) so "nobody ever got fired for choosing Java" became a reality.

Now that Java has been around for a long time we tend to forget this, but people couldn't even define what they were talking about back then - was it a language? JEE? A runtime environment? But they sure as hell were moving to Java.

Same as this "Internet" thing really.

[+] judk|11 years ago|reply
And of course "JavaScript". A moment's reflection tells you all you need to know about Java's unique combination of ambiguity and marketing power in the mid/late 90s.
[+] perlgeek|11 years ago|reply
Ask yourself: What other language could those enterprise projects have used?

Of course there's the whole C/C++ world, but people were starting to realize that managing memory can be a pain, and that text-based preprocessors can be a pain too. In comparison, Java seemed easier.

Fortran was known to be good for numerical applications, but had a bad reputation for everything else.

Pascal? COBOL? really??

(Actually I don't know why people didn't consider Pascal more seriously; maybe it lacked corporate backing?)

Of course there were scripting languages, but big corps are conservative, so it had to be statically type-checked.

Many other languages came later, or weren't seen as mature enough back then (C#, Haskell).

Java, OTOH, had a few pluses: static typing, OO, easy to learn (because it was a small language, and had similar syntax to C/C++), and a very well-documented standard library.

[+] giancarlostoro|11 years ago|reply
Delphi could of been a competitor, but there's barely any books on it. Also it was way too Windows centered, they should of invested in other platforms. I'm surprised they never bought out FreePascal and developed both a free and open source version of Delphi and a commercial version of it. Oh well. I really don't like some things about Java, but that's because I'm spoiled by C#.

I work at a programming lab as a assistant or tutor to students, I usually find myself helping people with Java the most, and it's not my strongest language, but I still manage to figure out my way around it.

[+] mamcx|11 years ago|reply
Other way to say the same on the answers on this thread:

Because MS own the enterprise/market and more exactly, the market for developers. So, apart of MS, what was left? C/C++?

Back in the days, the push of MS for developers was huge. Even in a latin america country (where I live) the MS conferences in a secondary city were huge. Everyone meet there. Even the people that do mainframes, netware, and be part of other communities like delphi, sybase. etc.

So, Java was the first concerted effort that intent to do the same. IBM/SUN/Others start to push for the community (because: How take of C/C++? Nobody). It start to show some kind of documentation, books, examples, etc. And provide a alternative, like everyone else explain here.

In short: Java explode because try harder to be the pepsi of the MS coca-cola.

[+] Nelson69|11 years ago|reply
The "dumb-proof" bit is from people that themselves are not strong in CS, typically... It's just snark as you say.

There was incredible demand for something like Java, gigantic efforts were put in to place to standardize the many different UNIX like OSes but apps were still incompatible. ANDF was an effort by the OpenGroup, I'm not aware of any real implementations of it. The big powers, save for MS, all wanted to build platforms where vendors could write applications that could run. Then along comes Java, it has all the modern bits in a language that people deemed needed at the time, there were plans for performance, it was fairly easy to implement a VM, it had a robust library, C-inspired syntax (Pascal vs C might have been the last big war before Java,) it had real binary compatibility. Sun, IBM, Oracle, just about every major company backed it, even MS sort of did. The performance got better, etc.. When the whole industry buys in to something, it'd have been amazing if it didn't get adopted. Then compared to C++ or C, the productivity gains were (and still are) staggering, GC and real stack traces are manna from the gods at the time.

Fast-forward to now, it's still got top shelf managed language performance, the tooling is maybe only matched by MS's tools. The counter question I'd ask, what has come up lately that could possibly replace Java? There are some interesting JVM languages, the CS dork in me would love for Scala to take off more but not for any qualitative reason that I could point to to say it's really better; I'm a functional believer but I'd estimate that less than 3% of the code written in any language anywhere is functional. Rust and Go are neat, but if you look at the whole picture, I don't think there is anything close to providing what Java does that would justify replacing it; save for possibly .net but then you lose the compatibility which was one of the primary desires from the start. I'd think something would have to outdo java or the game would have to change pretty dramatically and enterprises would start needing different kinds of software and I don't see that happening any time soon.

How many major technologies get replaced with nothing?

[+] jdswain|11 years ago|reply
Java 1.0 and 1.1 were mainly targeted at browser applets. Applets were maybe a bit before their time as the download speed was slow and there were issues with downloading the JVM. The JVM was a really big download for the time, with many users still on dialup or maybe slow DSL. You could never rely on which particular JVM the user had, and this was a cause of compatibility problems. At the time windows was almost completely dominant as an end user operating system. And as others have said Microsoft's embrace, extend, extinguish didn't help. Microsoft came out with a relatively decent IDE for java, but then started pushing a technology I think they called J/Direct that let you make windows system calls directly from Java, which was kind of useful, but also completely tied you in to windows.

The enterprise/server usage of Java really took off with JDK 1.2, AKA Java 2 Enterprise Edition. Sun and also IBM put a lot of effort into promoting this version of Java. It coincided with the dot-com boom, every company suddenly needed web applications, and Java was the best way to build them. All the popular programming books from O'Reilly and others were about various Java related technologies, and I guess all the good jobs were working in Java. IBM did a 'World Tour' promoting Java and even produced/produces their own Java runtime (based on Sun's version).

Windows was the standard desktop operating system in corporates, and it was a real advantage that developers could develop locally on windows and then deploy on a Sun/IBM/HP server.

Java application servers became a thing. Sun bought NetDynamics, one of the first application servers. Basically an application server gave you all the needed structure and plumbing to build your enterprise application, whereas often in earlier projects developers built this all from scratch.

Java was designed to make code reuse easier, libraries could be packaged into jars and due to the language's consistency it was easier to combine code from others than it is in languages like C/C++. A lot of the tools you needed to build internet apps were built first (or only) for Java. Things like crypto libraries, SOAP tools, XML, XSLT, all the new stuff at the time.

UML became a popular standard for design documentation at the same time too, and java was well suited to building UML based designs. UML came about by merging many of the leading OO design methodologies of the time to create one overall standard. It combined the methodologies of many of the leading OO proponents of the time, including Grady Booch, Ivar Jacobson, and James Rumbaugh. There were a number of good UML tools, starting with Rational Rose (purchased by IBM) that really suited designing enterprise systems and then realising them in Java. Java was useful here because of its consistent object-orientedness.

It was also accepted wisdom at the time that you could hire a team of average developers and they could produce decent Java code, you couldn't rely on the same result from C++ where there were many more ways to shoot yourself in the foot. It also helped that at the same time there were huge numbers of Indian developers entering the job market at reasonable pay rates.

Java quickly became the standard, using anything else was either risky due to lack of support, didn't have the libraries or tool support, or maybe didn't have a large enough base of skilled developers available. So Java was the safe choice.

[+] kyllo|11 years ago|reply
Windows was the standard desktop operating system in corporates, and it was a real advantage that developers could develop locally on windows and then deploy on a Sun/IBM/HP server.

This is a pretty big factor, that it's actually portable. Develop on Windows workstations, deploy to either Windows or UNIX servers without changing anything. Thats just not possible with C/C++. Difficult to even do with Ruby or Python.

Also, the class-based OOP design and interfaces make it easy for many programmers to work on little compartmentalized parts of the same massive system. And of course it lacks the dangerous features of a language like C++. Everything is an object with attributes and methods, and the objects can have a hierarchy. It's an abstraction that's pretty easy to understand conceptually without much CS knowledge, and it's easy to model business processes with it, so managers like it.

[+] cpswan|11 years ago|reply
I landed at a large bank in 2000 just as J2EE was exploding onto the scene. Looking back it was the app servers that mattered more than the language (though the language made the app servers possible).

BEA Weblogic was particularly popular. Its text (later XML) based configuration made it easy to get going (more so than IBM's competing WebSphere, where somebody had been too clever and used entity beans for config, so you needed to work with a DBA just to get started).

Weblogic also came with really good samples and examples, which covered pretty much all of the useful areas of the J2EE frameworks. Just about every app that made it to production started out with the sample code and got modified until it was doing what was needed.

There were of course other app servers. Cold Fusion had a loyal following for a while, but never escaped out of web apps and into line of business apps.

The move of J2EE and accompanying app serves from web to line of business (starting in the back office) was mostly down to productivity and skills. The main alternative was generally C++, which was viewed as harder to do and harder to hire for. There were of course many arguments over performance, but eventually the JVM got plenty fast enough and people learned to avoid the 'Bitter Java' anti patterns.

[+] bediger4000|11 years ago|reply
I don't know if I'm phrasing this in a calm, reasonable way, but your "snarky" reason has a lot to do with it. Not only was Java (pitched as) fool-proof (garbage collection!), managers really really did think that invoking "object oriented" like a magic word would help. I think that being able to develop on Windows NT (early 2000s context, right?) and run on something bigger was also a help.
[+] mindcrime|11 years ago|reply
I think that being able to develop on Windows NT (early 2000s context, right?) and run on something bigger was also a help.

Indeed. The company I was working for from 2000-2004 started down the Java path about 2000 (part of the reason I was hired, I guess) and one of the things people loved about Java early on was how you could program and build your code on a Windows box, then sftp the jar to an AIX box, and run it there unchanged.

"Write once, run anywhere" might not have worked out perfectly, but it was actually pretty good, especially if you were doing server-side stuff and avoided Swing and AWT.

[+] carlsborg|11 years ago|reply
About 10 years ago, at a Q&A session with the almost-CTO of a Fortune 100 enterprise:

carlsborg: how much java does your company use compared to c++, and where do you see that going? cto: we're at about 50% java - 50% c++, and we want to go to 90-10 carlsborg: why? cto: its costs less to do it in java

(While this math might not hold true today, at the time it did - java 1.4 was relatively easy to master in its entirety, and universities were adopting it as the de facto programming language)

I think what he meant was that it cost less to develop java applications compared to C++ ones, in the fairly common situation where you didn't need the low level power and performance of C++.

Personally, I think what helped adoption was the boatloads of high quality middleware, multiple vendor support, and a relatively fast moving and open standards process. The latter playing an important role - when a language/technology stack stagnates, early adopters tend to go elsewhere looking for an "edge" and take their allegiance with them.

[+] bernardlunn|11 years ago|reply
I think it is simply economics. Its the new Cobol, lots of lines of code to maintain, lots of developers know Java, so the cost of maintenance can be kept low. So when you build something new, the developers want to use Java because that is what they know and all the tools they have invested in are Java based.
[+] fizwhiz|11 years ago|reply
You've captured a very fundamental perspective here since the time spent on maintaining software is significantly more than building it (not sure what the Fred Brooks percentage is but I would guess 80/20 for the larger orgs).

Do you know of any small companies that grew to a point and said "Well, we've got a hiring bottleneck since there are much fewer good Python devs out there. So let's migrate to Java which will then pay dividends over the years since the cost of maintenance will be low."

[+] spo81rty|11 years ago|reply
You can write background, web, and desktop apps with Java. It is statically compiled and works very well.

I use C# for all the same reasons. Versatile, good tool set and does everything I need.

[+] dpweb|11 years ago|reply
Influence in the enterprise you have to look at the large consultants and integrators as bigco IT is taking their direction from them. IBM made Java the base technology of their stack in the late 90s and that's the primary reason. I would note that MS is extremely widespread as well as windows server, ad, mssql and dot net are prevalent, even more so as you get into the Smb market.