Ask HN: Would Java make it if introduced today?

28 points by jebblue ↗ HN
Given the meteoric rise of Java, I started using it in 1995; would Java the language and platform enjoy repeat success if it had instead been introduced today?

56 comments

[ 3.1 ms ] story [ 101 ms ] thread
Not if it were introduced with the original bytecode interpreter. The first few iterations of the Java Virtual Machine were horrifically slow, but it got better.

So if the Java language and VM were released today in their current state, complete with lambdas, streams, annotations, and HotSpot, then yeah, I think it would take off.

As is yes, as was would sink without trace.
...but the stack trace would still be visible from outer space.
It's not really about the technology, it's about the hook. I also started using Java when it came out, and there were two main hooks for us C/C++ coders:

- write once, run anywhere.

- write programs that run on web browsers (applets).

Today, it could be: "I want to write an Android app, and Google just released this new Java language/platform that I have to use."

In other words, any new language can make it if a large corporation creates a compelling reason for large numbers of programmers to use it.

(comment deleted)
I don't know about make it, but Microsoft Stack (C#/VB/.NET) would have a stronger dominance nowadays considering that it would grow without Java on it's back.
Ignoring of course that much of C# owes its existence to Java (and C++).
Honestly, as it currently stands, Java appears to me as merely a pared down version of C#. C# shares nearly all of the same major features, while adding in more useful ones like properties and Linq, plus the promise of many new features on the horizon, like the null propagating operator. All of those, plus the rest of Microsoft's development ecosystem, make it a much nicer language overall.

The only reason I don't think C# has taken over Java yet is because of how entrenched Java is, and it's wide cross-platform support. With mono, Silverlight, and Microsoft's newfound love for open-sourcing however, I think those arguments would be pretty much null if Java were to be introduced today.

> The only reason I don't think C# has taken over Java yet is because of how entrenched Java is

A far bigger factor is that C# is (or at least was) Windows only.

Wasn't C# developed after Microsoft failed to buy Java from Sun?
Worse, they took Java, put Windows only stuff in it, and Sun sued them...
Do you have any links / sources to back this story up? I haven't heard about this before.
This was back in the 90s, when Microsoft had their own JVM and own version of java called j++
I hesitate to pull the "Google is your friend" card, but this is one of those stories that's so well documented that a three word query will keep you reading relevant articles all weekend.
What's bad about LMGTFY is it assumes Google's results and articles would lead me the correct and objective sources - in a perfect vacuum - where you assume I know what to even query. C# and Java bring up a lot of things - and guessing won't necessarily reveal the context of what was in conversation.

In my opinion, the LMGTFY peanut gallery tend to be the glib one's. Always going for the short, clever smirks, never the depths, the wisdom; teaching others.

What's most toxic about this kind of - I assume well-intention people's behavior - I literally find myself Googling, and every now and then, hopefully an answer on forum thread where they say "Just Google it", "Just search it on the forum".

(comment deleted)
Isn't Silverlight effectively dead for new development?

I know it won't even run in Chrome any more, and it's been several years since Microsoft issued any updates.

Yes, but after the most recent Chrome update, that's just about as functional as Java applets are.
Not at all. Java's rise was the perfect storm of several factors: object orientation taken to its logical conclusion during a huge IT hype period for it (much like "Big Data" today), the tail end of a huge explosion of CPU architectures which made VMs very attractive, and CPU power finally getting to the point where pervasive garbage collection wasn't a detriment to large systems.

The platform as we have today is simultaneously weak in terms of its stagnant and outpaced feature set, and strong in terms of its optimization capability and ecosystem size. But its strengths were a function of its popularity: lots of people wrote Java so there was plenty of incentive to invest in the platform/ecosystem.

The only way I could see it taking off today as a new language is if there were a company willing to dump 10x the resources into it that Oracle or Sun ever have.

object orientation taken to its logical conclusion

Oh, how I wish. OO was never taken to its logical conclusion in the mainstream at all. Java's Nygaard-style OO was just a sugar coating on top of a generic procedural paradigm and a far cry from Smalltalk's example that was set over 20 years prior. Ironically, much of the JVM's early optimizations were born out of research into the Self VM - a prototype-based OO Smalltalk environment.

Yet thanks to C++ and Java's object models following the Simula legacy becoming so firmly entrenched into the mainstream as the OO, today the entire paradigm has become disgraced and is outright reviled in some circles (how many times have I seen FP enthusiasts jump every time it's mentioned...)

The Smalltalk and Self communities are minuscule. A more recent addition was the Io language, but that too is very small. OO died before it could really shine, though the Smalltalkers' legacy did somewhat live on as they went on to establish many of the software development methodologies and maxims that are taken for granted today.

OO's death has been exaggerated. Take a language like Scala, which has really powerful OOP constructs in the form of mixin-style traits (at least on the static side of object innovation). Not to mention many of the strongtalk people are now working Dart.

Objects will rise again (if you think they've fallen, that is).

I agree somewhat. You can also find object models in plenty of other places where many don't realize it (e.g. in many practical implementations of actor model concurrency). Those are all relatively small and indirect victories though. Who knows - maybe pure message passing languages might become the next fad soon enough.
The Clojure and Go people always like to talk about their non-object systems, which are of course very object-like. The only real functional purists is the haskell community.

I'm personally working a new language/programming environment right now based on traits/mixins; there is still a lot of fun to be had there.

Not sure how that can be answered. How would it compete against C#, which is basically Java++, and now open source and cross platform, and mature? But C# doesn't exist without Java, which it was heavily influenced by. Scala runs on the JVM. Does Scala exist if Java is "introduced now"? Scala is also a Java++.

I mean, Java was such a major influence that you have to stipulate how we deal with the fact that Java couldn't compete now because it would be essentially competing against future, evolved version of itself.

Agreed. If Java hadn't existed until now, it's entirely unclear what languages would be popular or even exist. Hell, would object oriented programming be popular, or would it be a niche paradigm?
OOP gained momentum in the late 80s and early 90s. Before we were programming in Java, many of us were using...C++. OOP might have been different, but it would probably still be dominant.
Java did a lot to strengthen the C++ style static dispatch branch of OO. The Smalltalk/Python/Objective-C school of OOP might have fared a lot better of there was no type safe language in the opposing camp.
The dynamic branch of OOP actually fared pretty well in Python, javascript, ruby, even in the presence of Java. As to why the others faltered (objective C being popular just because of Apple, smalltalk always being niche), I can't really say.
I don't think any of the languages which were introduced 20-25 years ago would make it.

All modern languages and all current iterations of the older languages are vastly superior by every imaginable metric.

All those 1.0s from the past would look like someone's toy project, because, well, that's what they were.

Java was a success because performance + ease of use compared with the languages then available, on the hardware available. Today, python, ruby etc are fast enough for many tasks.

Java was a hit in the enterprise because it had static typing, modules etc and was a complete product (tooling, doc - and stewardship from a big and respected tech company, who was neutral). OO helped, fashion-wise. C# and objective-C are the most similar languages today - but notwithstanding MS very recent moves, both are wedded to a proprietary company.

But if Java was introduced today, it would have a difficult fight against Go: Go is similar, and with Google's neutral backing, would have taken Java's role. Or maybe languages which Java displaced: delphi, ada, etc.

The realistic answer is: if java hadn't existed, something that met those needs would have been drawn forth by the demand.

Absolutely. The only thing really keeping Java from taking over the world is a slightly outdated standard lib. It's a great combination of speed, portability, community, OO, native types, functional prototypes and some clear lines drawn so you can't shoot yourself in the foot too terribly bad.

Oracle's API architects are concerned with selling as much WebLogic licenses as possible however, so don't expect changes soon. However, the community has come up with some absolutely brilliant libraries where Oracle has clung to legacy technology.

All in all, it's a superb language with a bright future. Maybe we'll get better leadership as Oracle is forced out of the closed source era (it's happening at Microsoft, so don't laugh).

Well and Java evolution stalled for 5 years during the Sun to Oracle transition, while the rest of the world passed it by. Java 8 should have launched by 2010.
Instead of answering the question, I'd like to point out how different the world of programming might look today WITHOUT Java. Java was the first maintstream GC language (no more malloc), fully object oriented and the first byte code based VM language. Prior to Java, you were either writing in interpreted languages like Perl or in C/C++.

Java brought programming to a higher standard with clear syntax, easy of use and a much faster learning curve than languages up to that point. That paradigm gave rise to new languages like Javascript and new designs for large scale software.

So, I think it's irrelevant if Java would make it if introduced today since I am not sure today would be here (or at least in its current form) without Java.

The only connection between Java and JavaScript is that JavaScript stole Java's name as a marketing ploy for Netscape scripting. (I would call JS a competitor to Java applets, but it wasn't even that. It was a complementary technology.)

And "mainstream" only referred to marketing budget. Perl and Python and Tcl had already launched (Perl and Tcl quite popular for the era.) Java's main novelty was the relatively strong cross-platform story due to the VM and GUI bindings.

To further that point, JavaScript is more similar to Scheme if anything.
Even more ridiculous is that JavaScript and Java are the same age.
So, you could ask: Would JavaScript make it if introduced today?
More importantly: Would JavaScript make it if it wasn't forced on everyone by way of web browsers?
(comment deleted)
There were plenty of other languages with GC. Perl for example. Not sure what "full object oriented" means but I think smalltalk might count? Also plenty of byte code languages. In fact VB was a bytecode language.

I also don't believe Java had any influence on JavaScript except for using the name for marketing

> the first byte code based VM language

UCSD pascal would like to have a word with you. Circa 1980

> fully object oriented and the first byte code based VM language.

Smalltalk would like to have a word with you. Circa 1984

> Java was the first maintstream GC language

Basic (in all its variations) would like to have a word with you. Circa 1968; And perhaps it is going to bring along its buddies Lisp (1958?) and APL (1950-1960, depends on who you ask).

All of these languages were mainstream at one point or another - in a much smaller world, but still, mainstream.

Java wasn't the first to offer all of these together - Smalltalk did that in 1984, and I'm not sure Smalltalk was the first.

> Java brought programming to a higher standard with clear syntax, easy of use and a much faster learning curve than languages up to that point. That paradigm gave rise to new languages like Javascript and new designs for large scale software.

Java's syntax is clear only to someone who is versed in Java (or a Java like language like C, C++, C#). Python came out at the same time (1991) and brought a syntax much, much clearer, with a much faster learning curve. It was also VM based and GC, by the way - and having programmed both in 1991, I can tell you Python was often much faster (mostly owing to dicts being implemented in C, whereas Java was all interpreted).

> So, I think it's irrelevant if Java would make it if introduced today since I am not sure today would be here (or at least in its current form) without Java.

I agree. But I don't think that's necessarily a good thing. Specifically, I don't think Java deserves any accolades. It's the COBOL of the 21st century. If Java wasn't around, and Python took over, I think we'd be in a much better place. If Java wasn't around and C/C++ continued their reign, I supposed we'd be slightly less well off. We don't have to agree on opinion. But we should be able to agree on facts.

You think we'd be better off with Python, a non-typed language against a typed language? Really, I like Python, but speed as well as typing is lacking. I'm glad we have both languages.
I'm referring to the hypothetical situation in which Java did not come along, not to modern Java vs. modern Python.

Yes, I think we'd have been better off with Python + C++ (which is likely had Java not come along).

w.r.t Speed - one of the reasons Python's speed is (still) lacking, is because it never got the amount of work Java did. JavaScript is no longer lacking in speed, and neither does Lua - and both are as dynamic as Python. Lua is much more impressive in this respect - LuaJIT's speed, the work of one person, is comparable to the best JavaScript engines, works of multiple big multiperson teams.

The original Java was a little safer than Python, but definitely not on par with what you'd consider a modern staticly typed language. There were no generics, and everything was cast all around e.g. if you used a dict/map container. It was easy to have static typing locally, but not globally. The standard library at the time was really, really bad. I think I considered it acceptable only with Java 1.5.

A lot of modern Java is like it is because it was in widespread use, and it was so bad to begin with. Had it been Python instead, perhaps Python's bad parts would have been addressed earlier (including lack of type checking and lack of speed - both of which are coming of age)

Don't forget the culture of design-pattern-overdose, dogmatic architecture astronautism, and extreme overengineering that it propagated. This happens in C++ too, but in Java, it was so easy to build obtusely baroque designs with disturbingly long chains of indirection and have everything still work for the most part... while consuming massive amounts of CPU time and memory.

I worked briefly with Java applications in the early 2000s, and that was certainly not an enjoyable experience. I won't miss the bureaucracy, extreme waste, and fervently dogmatic adherence to "best practices" that created more busy-work than anything else.

"If all you have are classes, everything turns into an object."

If they invest as much in marketing as they did, yes. Just look at the success of mongodb.
Java was the original Web Scale.
Well, for one, the notion that it was 'write once run anywhere' wouldn't convince too many people - after all, everyone's already got a language called LiveScript in their browsers and that's turned out to be good enough for 90% of use cases.
What are the other assumptions in this hypothetical scenario? Does C# exist? Does Scala exist? Does F# exist? You could argue that none of these would exist if Java didn't.

What might we have instead? C/C++ of course, Python/Perl/Ruby and friends too. QBASIC is older than Java and Visual Basic was just a cleaned up QBASIC, so we'd have that. Borland's Pascal-derivative Delphi was a decent language; maybe that would've done better without Java.

Would Haskell and the MLs have done better? Perhaps, because at the time it came around Java was quite a productive language. Or maybe I should say, it was a nice language before everybody and their uncle discovered the design patterns book and started implementing AbstractFactoryInterpreterEventLists willy-nilly. Without Java, I think it's plausible that the design pattern craze - a lot of which is just attempting to shoehorn functional programming into an OO language - would never have happened. And people might've discovered actual functional programming earlier and the state of the art might've been closer to F# than C#. So back to the original question, in this scenario, Java wouldn't make it, because honestly, although Java is a decent language but F# and friends are way better.

I think it's possible, if this hypothetical Java had strong corporate backing. I'm not sure Oracle could do it, but if it came out of Google, I bet it would catch on. The language Go has shown you can release a language no one really needs (sorry enthusiasts, just my opinion) that will still be successful.
Maybe. Java does one thing really well - marketing. Primarily to schools. It's hard to compete with a language that every graduate knows, and worse, it's the only one they "know."
If Java was released today, it would still be valuable. Java is a small, well defined language (without many surprises). Java runs on an open source platform, OpenJDK. The JSR's are incredibly well designed -- Web programming (Servlet, JSP, JSF), Message Driven Beans, JMS, JPA, and JAXB.

If you look at benchmarks of web applications/frameworks, Java-based ones are blazing fast.

I don't know, but Java definitely succeeded at least in part because of the programming environment at the time.

I didn't live through the time that Java saw it's rise in use on the enterprise, but what I've been told by others that was a big deal at the time were two things combined that made it attractive, and it being one of the few languages that was very accessible that had these two characteristics. These were:

* Garbage Collected language.

* Being able to write code in Windows (which is what most enterprise developers used then and even now), and deploy on Linux/other OS reliably.

Again, this is just what I've heard from others that were there, so feel free to correct me if I'm wrong.

Today, there are other options, so maybe it wouldn't be as big a sellilng point. But to me at least, it is still one of the languages that allows this the easiest by far.

The way that the Java platform evolved very slowly just seems rather unlikely nowadays. Sun didn't allow for Java extensions that made it too platform dependent. To this day Java's platform independence is perhaps its greatest legacy, since platforms have changed a lot and the Java code can still be used even for the latest hardware.

But the idea of a proprietary platform is just exotic nowadays. I doubt it that when they started the Java project that they imagined it that most of it would be free and Free. Everyone wants software to be a commodity. I don't know how they would fund a similar project knowing that it would compete against very much free and Free solid alternatives.

Also, browser plugins are dead. So something like Java applets would hardly take foot.

Like others have said, one of the big selling points for Java was Windows development. The interfaces sucked. But the need was there. Once Microsoft came up with .NET that profitable market was challenged.

A lot of Java alternatives nowadays can go a long way from just hosting web services on Linux. So Java's selling point of supporting many different platforms would not have been as interesting. Also, Apple restricts JIT on iOS, further compromising alternative platforms on that platform so even if a new Java wanted to support iOS it would have to settle for less.

Settling for less was in fact one of Java's goals. It helped it with platform independence. But it didn't make many platform dependent developers too happy either. :-)