Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What are the factors that have made Java a success as a programming language in enterprise computing?

share|improve this question

migrated from stackoverflow.com Jan 24 '11 at 12:52

This question came from our site for professional and enthusiast programmers.

4  
Add C# to the question. –  Amir Rezaei Jan 24 '11 at 13:13
4  
@smirkingman Could you elaborate on how Java fails to be truly cross-platform? –  user1249 Oct 4 '11 at 17:11
5  
@smirkingman you can hardly blame Sun for the Microsoft JVM not being compatible. The Microsoft JVM was withdrawn in 2001. Do you have examples relevant for the world today? –  user1249 Oct 4 '11 at 21:35
4  
@smirkingman, so basically you rant based on 10 year old experiences. Isn't this similar to discussing Windows 7 without trying it based on a bad Windows ME experience? –  user1249 Oct 5 '11 at 12:15
3  
@smirkingman, Sun versus Android was no problem. Oracle versus Android is a completely different matter. Android is not the reason that Java succeeded in enterprise computing, which is what this question is asking. –  user1249 Oct 5 '11 at 21:19

11 Answers 11

Language simplicity (easy to parse and analyse) + reflection (easy to obtain properties of the compiled and running code) = great tools ecosystem. Just what the industry needs.

share|improve this answer
8  
The idea of calling Java "easy to parse and analyse" fills me with horror. And Java's idea of reflection is a joke compared to what we've had since the start of the 80s. –  Frank Shearar Jan 24 '11 at 13:03
8  
@Frank, compared to C/C++ it is definitely easy to parse. What other language would you call easy to parse if Java is IYO so difficult? No intention to start a language war, I am genuinely interested in your view :-) –  Péter Török Jan 24 '11 at 13:12
7  
Anything that takes more than a napkin's too complicated a syntax, in my book. But my favourite languages are Common Lisp, Prolog and Smalltalk. Haskell's syntax is also really clean and intuitive. So, in my opinion, calling Java easier to parse/analyse than C++ is like saying that K2's shorter than Mt Everest. –  Frank Shearar Jan 24 '11 at 13:25
5  
@Frank, Java grammar can be easily translated into LL(1). Compare that to C++ which either needs a GLR grammar or some really dirty lexing hacks. And the language semantics is trivial compared to the other imperative languages (it is close to Modula 3). There is a third component of success: Java is not scary for the average programmers, whereas "no syntax" languages like Forth and Lisp kicks them unconscious on a first encounter. –  SK-logic Jan 24 '11 at 13:30
3  
@All: I think the reason Java is so popular isn't so much the individual items you're discussing, but the fact that Java strikes a balance between them. It is definately not functional, but implement enough functional ideas to be useful. But it blends that with imperative programming which is inherently simpler to understand and read (at least at first, work with me here :)) Add the fact that it is easily extensible. Now the language is maturing/matured, and we have many libraries, dev tools and a pretty well optimized runtime. For most business development, that's exactly what is needed. –  Michael K Jan 24 '11 at 14:00

It wasn't c++. In a world where everything was expected to be rigid, solid, and stable, Java came along dressed up like c++, proclaimed to be easier to use, and stole away all the c++ developers that were tired.

Plus, Sun threw trucks of money away marketing the language. Most vocal at the right time.

share|improve this answer
4  
Note that this was at a time where Windows was notoriously good at rebooting and blue screening. The youngsters of today have no idea of how the bad old days were... –  user1249 Jan 24 '11 at 13:38
7  
Segmentation fault at 0x0293ad. Here's a complete dump of my memory onto the computer screen. Good luck finding your faulty pointer. -Sincerely, Windows –  Neil Jan 24 '11 at 13:51

Robustness and garbage collection.

The JVM is very good at running for very long. Also Java code is easy to write in a way that unused objects do not linger giving memory leaks.

Also stack traces are useful but that is just icing on the cake.


Edit: Completely forgot: Java has multi-threading built in, in a well defined cross-platform way. This goes very well together with web servers. To my understanding this was much harder in C and C++ at that time.

share|improve this answer
    
What do you mean by very long? –  Abimaran Kugathasan Jan 24 '11 at 13:52
1  
@Abimaran, months and years without restarting. –  user1249 Jan 24 '11 at 16:33
1  
You don't necessarily have to put a ton of effort into avoiding C++ memory leaks, although C is a different matter. There are tools to find leaks in both languages. It is possible to get a memory leak in a Java program, although much more difficult, and it will be harder to find than in C or C++. –  David Thornley Jan 24 '11 at 18:49
3  
@David, all this happened in the late 1990'es. To my understanding C++ was not as mature then. –  user1249 Jan 24 '11 at 19:08
1  
@David, most likely. I just remembered though, Java made multi-threading easy. –  user1249 Jan 24 '11 at 23:41

Disclaimer - I'm a JUG leader and writing a book on Java - so I'm biased :)

  • At the time it was a perfect successor to C++ in that it mimicked much of the syntax that enterprise developers at the time were used to. The key difference is that Java lowered the bar for entry by taking away the need to directly deal with pointers and memory management. This is partly technical truth and partly perception, it's still easy to cause memory leaks in Java and you really should think about your pointers :). I tend to value developers who come from a C++ background into my Java teams - they get how it works under the hood.

    • It's no coincidence that C# started out looking very much like Java in its syntax, mass adoption is important (Scala and Clojure enthusiasts take note).

    • It's no co-incidence that VB was wildly popular due to lowering the barrier of entry into 'programming'. I'm not saying it's right, but there you have it :)

  • Java is seen as being verbose and relatively easy to read, making it more maintainable than say C++. Yes I recognize this is a fallacy, but perception is important. It's fair to say that there's a backlash against Java for its over verboseness at the moment.

  • Write once, run almost anywhere. Java's "run anywhere" is a little false, but for ~98%+ (very unscientific quote) cases it is true. The fact that Sun (now Oracle) spent loads of time and effort into making the JVM run on the enterprise OS's paid dividends in this regard.

  • The GC - Love it or hate it (certainly don't expect it to work magic), it makes life easier for developers. A little part of me dies every time a developer tries to convince me that the GC is a silver bullet, but again in a majority of cases it does tidy up after you .

  • Eco-system of libs/apis - this wasn't true at the start - but at some point it just exploded. I just Google "Java API X" and something always pops up.

  • Open Source - You can pretty much run an entire open source, free stack of Java based stuff (including App/Web Servers, DBs etc).

There's loads more, but I should get back to actually writing some nice integration tests dealing with Lists and Maps (no manual memory allocation!), using a free open source Java API (JUnit and pals) and then deploy to my 3 environments (Unix, Mac OS X and Windoze).

share|improve this answer
1  
+1, especially for the last comment. –  Michael K Jan 24 '11 at 14:02
4  
The verboseness is one of the things that make Java programs relatively easier to maintain than many other languages. –  user1249 Jan 24 '11 at 16:32
9  
As someone who isn't much of a Java fan, I was impressed by this post. –  cthom06 Jan 24 '11 at 19:40
2  
@ThorbjørnRavnAndersen It's debatable whether verbosity helps. I sometimes find so much verbosity (and its companion problem, boilerplate code) actually obscures a given piece of code, and hinders my understanding of it. –  Andres F. Jul 23 '12 at 17:00
2  
@ThorbjørnRavnAndersen Well, I'm thinking in general about Java: there's a bad noise-to-signal ratio. But just as a single example, the unnecesarily long type names, and the poor type inference which makes you type them when the compiler should infer them. In general, Java's lack of features translates to verbosity and boilerplate. And also programmer culture makes it a VeryVerboseLanguageWithLongIdentifiers<WhichIsTooLateToChangeNow> :) –  Andres F. Jul 23 '12 at 22:09

You do not have to be very skilled. (I am not saying that Java programmers are unskilled.)

Garbage collection: You do not have to balance your new and delete. You do not need to think about object ownership. Rich standard Libraries: C++ still suffers form that fact. Old C++ libraries like Qt have its own string implementation. Single inheritance: You do not have to think about the pitfalls of multiple inheritance.

You do not have to think about ... in the first place.

share|improve this answer
5  
Why? Please expand upon your answer. –  Walter Jan 24 '11 at 16:07
    
Yeah, but typically the business logic of an enterprise application is much more complex than that of an embedded system or even a desktop application, that are usually written in C/C++. Thus programming in Java may be easier than programming in C/C++ but programming Java applications is more difficult than programming C/C++ applications. –  m3th0dman Jul 23 '12 at 15:20

There's a very simple explanation for Java's adoption into the enterprise. It was IBM. Once IBM committed to Java, their customers followed suit (didn't really have a choice). Then the case studies came out about large applications being successfully ported to Java, and Java on the mainframe. Time this with the rise in popularity of Java in academia. And you have a perfect storm.

The factors that others have mentioned (simpler memory management, easy transition to C++, multi-platform) made it easier once it got moving. But IBM is what gave it the initial traction.

share|improve this answer
2  
I would agree that IBM was a silent but strong force for Java adoption. Say what you want about IBM, but they embraced a language from another company with relatively little argument and mostly no "embrace and extend" mentality. They knew Java got it right and it resonated through their customer bases which is HUGE. –  Xepoch Jan 24 '11 at 17:18
4  
I'd also throw props out to Apache. If it weren't for Tomcat and Struts, web app development would have been a lot longer catching on. Who else remembers writing CGI scripts in Perl? –  TMN Jan 24 '11 at 19:23
1  
Please don't remind me...seems so primitive but it was only like 13-15 years ago. –  Mike Brown Jan 24 '11 at 19:48

A lot of it was the hype. Java rode the rise of internet technologies in the mid-90s, and managed to establish a critical mass of mindshare and tooling in a relatively short time. By the time people figured out that applets really weren't worthwhile, Tomcat and the JSP spec were out, and people were creating dynamic data-driven web sites with something other than CGI scripts. It also didn't hurt that Microsoft was a Java supporter early on. And once developers got comfortable with JSPs, Java got EJBs. And when everyone figured out that EJBs were a nightmare, we got Spring and a bunch of ORM solutions. So I think the key is that Java got a good start, and has managed to overcome its mistakes and adapt to changing technologies. It's sliding out of favor, but I haven't seen anything up-and-coming that has enough mass appeal to replace it.

share|improve this answer
    
Why would you say it's sliding out of favor? –  Michael K Jan 24 '11 at 19:21
2  
There's a lot of criticism of Java lately. No closures, type erasure hassle, too verbose, concern over Oracle's future plans, etc. It's now "old tech", and all the buzz is over functional languages and DSLs, and C# and .NET have matured to the point where they offer a credible alternative. I work for a major software company and nine months ago we abandoned Java and switched to .NET for our future development. Of course, we just hired Oracle's ex-president, so we may swing back the other way, who knows? –  TMN Jan 24 '11 at 19:34
1  
Not going to downvote you but "a lot of it was the hype" is complete rubbish. I evaluated pretty much every credible language option during the internet boom, and Java won on genuine technical grounds. portable, fast enough, excellent garbage collection, maintainable, internet-oriented, great libraries. easy win. The fact that there was industry momentum behind it as well was only icing on the cake. –  mikera Jan 25 '11 at 8:36
    
Java is actually cathing on in the finance industry. Before it was all C++, now quite a lot of places use Java. Some top IBs even use Java for algotrading. –  quant_dev Apr 16 '11 at 11:16

Dynamic loading/linking with Class.forName("mypackage.SomeClass"), and it was free. Many comparable toolsets just for GUIs were $10,000 per developer seat.

share|improve this answer

In the mid-1990s, java was cleverly hyped by the marketing departent of Sun Microsystems. They flooded computer books publishers, computer magazines, web sites on the internet with articles on java, tutorials, giving the JDK away for free etc, quickly pushing java servlet API and other server-side technologies.

Java gained a user share rapidly, then lots of young graduates entered the job market, getting IT pro and developer jobs during the first internet bubble, with a desire to reuse existing java skills (could be used for anything).

Sun marketed agressively, in response to , and just as Microsoft did back then, threatening to take over low-end computer-industry markets with cheap windows 95, windows NT etc.

share|improve this answer

It's not just for the language excellence or platform advance.

Back then, beginning of '90s, Java is the only web oriented enterprise computing capable framework. There were no other.

My personal impression of Java was Java applet run on the Netscape browser. It was really cool! Java was widely recognized as one and only Internet programming language at that time.

share|improve this answer

I'd like to stress the point knivil makes that the single most important advantage of Java is that it has a good and very large standard library. The feature set of Java resembles C++'s, but the latter only has a very limited standard library. Imagine: C++ even lacks a GUI library! Just about every non-driver application needs one, but in C++ you're left on your own. So if you want to start a new application, you first have to choose one of the available third party libraries, all of which have severe shortcomings. This heightens the threshold for using the programming language considerably.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.