No Future In Java
A C++ programmer walks into a Usenet newsgroup, "I don't see the point of Java!" he announces.
"It allows your code to work on many different platforms...", replies a local Java programmer.
The C++ programmer is unconvinced, "I can already do that with C++", he blusters.
"...without re-compiling your code for each platform", adds the Java programmer with a smile.
"What?!", shouts the C++ guy, "Why would I EVER need to do anything like THAT?!?"
Okay, so as jokes go it's pretty lame, but conversations not unlike the above were ten a penny back when Java first appeared in the mid 1990s. A lot of programmers just didn't get it — but then, why would they? They had a lot invested in their current tools, and C++ (Fortran, BASIC, whatever) was serving their needs just fine. The newfangled World Wide Web may have been a fun distraction, but it wasn't likely to change the programming landscape, was it..?
Roll forward almost a decade and a half, and it's blindingly obvious why the internet needed something more than C++. The software world evolves, but usually in slow baby-step increments. Very occasionally, however, the industry throws up an idea which tempts us with the promise of a giant leap forward, and a clutch of new and unusual tools emerge to explore the possibilities. Not all giant leaps deliver — let's not forget Java started life aimed at a smart device explosion which failed to materialise (until years later.) A quick name change and a fresh lick of paint later, and Java became the internet focused technology we know and love.
Some say we're rapidly approaching another seismic shift in the software world, at least from a desktop perspective. Whether you agree with the idea or not, Cloud Computing and Rich Internet Applications have many excited (guilty!) In anticipation of this brave new world we have the accompanying slew of strange new tools: Silverlight, AIR, and our very own JavaFX, which debuts in only a few days. They promise to change forever the way we think about user facing software, yet already seasoned Java programmers (eg. some respondents to Fabrizio Giudici's blog a couple of week back) are asking "What?! Why would I ever need to do something like that?!?"
As I see it, there are two questions here: Firstly, will Cloud/RIA computing become a significant force on the desktop? Secondly, assuming it does, how can the Java community grab a share of this market?
The first one is easy to answer, a quick Gallic shrug and an apathetic "dunno" will suffice. It's the same answer we can confidently give for man made global warming, or whether any of us will have jobs this time next year. Short of James Gosling becoming the eleventh Doctor Who, we can never say with confidence how things will turn out for JFX until some time after the market has already decided. Tipping points are never appreciated when they happen, it usually takes a hefty dose of hindsight to uncover why things ended up the way they did. All we can do is guess at a reasonable worst case scenario, and equip ourselves accordingly.
Let's put the first question to one side by assuming RIA's are the future — what should the Java community do about them?
Giant leaps are often benefit from new languages, do RIAs need one too? The temptation is to defend our current tools against any criticism, to pretend not to notice their blind spots, or to claim their deficiencies don't matter. Recall how our comical C++ coder was quick to equate the cross-platform ability of C++'s source code with the platform neutrality of Java's binaries, and was totally blinded to the benefits of Write Once Run Anywhere in a network-centric world.
Surely the most pragmatic answer is, "we don't know"? It seems reasonable to assume RIAs may benefit from some sort of DSL, although Swing and WebStart may also suffice. It all depends upon whether the informality associated with browser-based user interfaces is a passing fad, or a permanent change in end user tastes. But one thing we can say with certainty: no industry can progress unless someone takes a punt. The only reason we're talking now about "all the screens of your life" (to paraphrase the JavaFX motto) is because Sun took a gamble with Java. (Just how far would we have got with C++ and Perl...?)
There are indeed some similarities between the early days of Java and JavaFX: JFX, like Java, will be launched in the face of a well established (and entrenched) opposition, and doesn't truly innovate so much as integrate and focus established but less visible ideas into a tool suited for solving a particular type of problem. But there's also some pretty stark differences too: in 1995 Java could ride on the guaranteed street cred of bringing eye candy colour to otherwise grey HTML pages, yet in 2008 JavaFX doesn't have the market to itself, and rippling lake applets no longer wow today's fickle users.
JavaFX's big trump card is it's interoperability with Java. Rather than the client/server chasm inevitable with rival technologies — Java on the server, ActionScript on the client, for example — the developer can decide how far across the span of the application Java should reach. It's possible to develop a thin JavaFX Script veneer over heavyweight Java libraries, or (the other extreme) to restrict Java to only a server side role and let JFX rule the desktop — the option is left open. This causes familiar chasm-straddling technologies (SOAP/JSON/REST/etc,etc,etc) to be demoted to implementation choice instead of mandatory requirement.
Only time will tell what the future has in store for JavaFX. If it turns out RIAs don't deserve a whole new platform, and Java will suffice, then we haven't lost much in hedging our bets. If the opposite is true, however, then at least JavaFX still gives us a fighting chance...