Is Flash better than Java?
Summary: Over the past few years alternatives to Java in and around the browser have been gaining traction, especially Macromedia Flash. Using Flex and ActionScript, you can write sophisticated browser-hosted or desktop interactive business applications. So is it time to toss out your webtop Java code?
For various reasons, Java applets have never worked all that well but we some folks use them anyway, for example in business charting and other graphic visualizations. Over the past few years alternatives to Java in and around the browser have been gaining traction, especially Flash. In this article I will argue that it's time for Java to take a lesson from its competitors (on the client side) and address some of the shortcomings that are allowing them to flourish.
Flash
The most serious competition for webtop Java is Macromedia Flash. Flash started life as a very small footprint (~180K) media plug-in for Internet Explorer and Netscape.Flash should light a fire under the Java community Adobe acquired Macromedia a few years ago, and has been pouring resources and marketing into it. Now, Flash 9 is an advanced development platform. Through Flex and ActionScript, you can write sophisticated browser-hosted interactive business applications. The run-time is still relatively small (much smaller than Sun's Java, about 1MB), it's frequently updated with "frictionless" installs, supports vector graphics, streaming video, Ajax-y back-end interaction, and many other features that users find appealing.
Flash Lite is extending the Flash ecosystem to mobile devices. What was previously the domain of J2ME (now called Java Micro Edition or Java ME) is now being Flash-enabled. Because Flash is vector-based, applications are easier to port from one screen size to another, and users don't see jaggies because Flash has always done anti-aliasing. When I read this article from Adobe it really made me think. Even if you don't do anything with J2ME, Flash Lite is draining more mind-share away from Java.
Adobe Apollo brings Flash to desktop applications, in direct competition with Java Swing and Rich Client Platforms. It holds an attractive promise of being able to share code between browser-based, mobile-based, and desktop-based applications. Well, hasn't Java been doing the same thing for 10 years? Yes, but its execution has been flawed in many ways.
Analysis
Ok, so what does all this mean for developers? The software industry has a tremendous investment in Java code, millions of lines and billions of dollars. We don't want to move to another language like ActionScript just for the fun of it, right? If there was a good enough reason, then it could be justified. I'm all in favor of new ideas and moving to better, more efficient technologies. In fact I've used that argument more than once to move C code to Java or C#. But recoding from Java to ActionScript? There's no way that qualifies. IMHO, there's no technical reason that Java can't do everything that Flash can do, with a little work.
The most serious problem that has allowed alternatives to flourish is the poor Java applet user experience. What if we could toss that out and replace it with something better?
I'm talking about work to make Flash-like small footprint installs of a Java-based run-time. Instant-on and streaming compressed content (no more Java progress bars). Frequent updates, fully backward compatible (no content left behind). Viewer-like security with no scary prompts for the user but no complicated signing either. And so forth. I'm sure you all have lots of ideas about this too.
What about F3?
Some have suggested that the new F3 language is Java's "Flash killer". F3 is an experimental declarative scripting language with static typing, type-inference, declarative syntax, data-binding, 2d graphics, declarative anmiation, and more. It demonstrates that the Java platform is highly competitive with competing platforms such as Flash. But F3 is a different language from Java. I'm talking about using Java code that already exists. Also I haven't seen any demos of F3 running inside the browser, only through Java WebStart (.jnlp). F3 doesn't address the underlying problems with applets and Java installs that Flash addresses. It can't be a Flash killer until its user experience is as good as or better than Flash.
Conclusion
For years the industry has waited for Sun to solve this problem and they haven't. Now, with Java 7 being open source, we could do something about it ourselves. Java experts could work together to build an open community around a new Java-based viewer (which we might not even want to call "Java"), and reverse the brain-drain away from Java technologies, preserving our investment in Java code and expertise.
Is Flash better than Java? No, just far better executed for some important use cases. Failing to address this, and allowing Flash and other alternatives to continue to grow and improve unchecked, is going to lead to competitive disadvantages or needless conversions down the road for Java developers. Instead of participating in endless arguments about esoteric subjects like closures and native code, competition from Flash should light a fire under the Java community and force it to respond with radically better user-facing solutions.
Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.
Talkback
Each Has Its Purpose
For the client side, nothing beats Flash/Flex. Write the exact same web application in DHMTL, Java, Flash/Flex, or any other technology you choose, and it won't take much opinion polling to conclude that, hands down, Flash/Flex is the winner.
For servlets and web services, Java is a great choice. But, it will never gain dominance when it comes to the client side of things.
R. Grimes
Selecting the best tool for the job at hand?
Accept the Challenge
I built this web app in 3 weeks using Flex that consume J2EE middleware web services. Duplicate it in Java in the same time frame. Then we'll talk.
https://secure1.sinclairoil.com/reservationsv3_rsc/flex/Reservations.html
R. Grimes
laugh a little
Not bad...
RE: Accept the Challenge
I was referring specifically to the client side
The comparison is Flash and Java applet then
Ok for client-side I agree Flash is way superior to Java applets. But again on the desktop, Java applet (signed?) is not a model that can be compared to Apollo. Niether is just Java runtime (JRE) comparable to Apollo. I have a post on my blog with my thoughts on your comparison
Vijay
Dekoh
http://pullur.wordpress.com
I agree...
Maybe it's just me, but
And then there's flash video...for the life of me, i don't see how that's better than streaming to WMP, VLC or Quicktime....lord knows the video quality is generally of lower quality....nevermind the fact that if I switch from windowed to full screen it starts downloading from the beginning :-/
Flash=flashy, Java=serious
Can Java=flashy too?
I assume you mean things like animation, video, and vector graphics, right? Things like the advertisements on this web site?
I'm arguing that Java technology can be adapted to be competitive in this area as well. The basic technology is there, (see the 'Filthy Rich Clients' book or recent developments with F3 and SWT) but the execution / user experience needs work (compare Flash and Java installs for example, or the startup time of Flash content vs. applets).
Flash not so flashy
So, if they decide to make java flashy, then I hope they manages to avoid such problems.
Flash can be serious
Like?
Like what? Java can make full applications, for example NetBeans.
"In Java, you have to write a really complicated script for HTML transfer"
Huh? I never had troubles with files & IO in Java. What are you finding complicated?
Serious... you mean like the "Lake Effect" ? Or Flashy like Yahoo Maps?
That seems to be the exception to the rule
Now that I've looked at a flashy map, I'll open NetBeans and do some real work . . .
You mean real work, like this?
You need to get out more.
>> I'll open NetBeans and do some real work . .
You mean do something like this?
http://www.scrapblog.com/
"Flash should light a fire under the Java community"... Indeed. This is only the beginning. Flash, Flex and Apollo will definitely give Java a run for the money for UI development.
I really don't like flash sites.
Dancing cows
There are counter-arguments, of course, but throwing out images of "dancing cows" is a distraction in an otherwise important discussion.