Ask HN: Why does the enterprise have such a strong affinity to Java?
45 points| fizwhiz | 11 years ago
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."
[+] [-] mindcrime|11 years ago|reply
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
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
Isn't it always just in network order?
[+] [-] btilly|11 years ago|reply
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
[+] [-] kyllo|11 years ago|reply
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
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
[+] [-] taylodl|11 years ago|reply
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
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
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
[+] [-] techdebt5112|11 years ago|reply
[+] [-] AndrewDucker|11 years ago|reply
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
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
[+] [-] charlieflowers|11 years ago|reply
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
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
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
Python is four years older than Java. When the latter was released, Python was already at 1.0.
[+] [-] spullara|11 years ago|reply
[+] [-] no_future|11 years ago|reply
[+] [-] sz4kerto|11 years ago|reply
All in all, it's good enough and it does not really have any glaring flaws.
[+] [-] zorked|11 years ago|reply
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
[+] [-] perlgeek|11 years ago|reply
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
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
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
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
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
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
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
[+] [-] mindcrime|11 years ago|reply
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
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
[+] [-] fizwhiz|11 years ago|reply
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
I use C# for all the same reasons. Versatile, good tool set and does everything I need.
[+] [-] dpweb|11 years ago|reply