Is Flash better than Java?

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?

TOPICS: Open Source

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.

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.

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.

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.

Topic: Open Source

Ed Burnette

About Ed Burnette

Ed Burnette is a software industry veteran with more than 25 years of experience as a programmer, author, and speaker. He has written numerous technical articles and books, most recently "Hello, Android: Introducing Google's Mobile Development Platform" from the Pragmatic Programmers.

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.


Log in or register to join the discussion
  • Each Has Its Purpose

    For me, it's not a matter of which is better. It's a matter of which is better for which part of the web application solution.

    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?

      That's crazy talk. You'd better wise up and join some fanboy club soon or nobody will take you seriously. If you can't come up with at least 10 reasons why your personal choice is better than everything else and 10 reasons why everything else blows then you're just not taking your job seriously.
      • Accept the Challenge

        10 reasons is pointless. Those could be debated all day.

        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.

        R. Grimes
        • laugh a little

          jason's reply was tongue-in-cheek
          Robert Kohlenberger
        • Not bad...

          If my particular area of expertise were writing web UIs, I might take you up on that. But then again, maybe I wouldn't even consider it since being an expert I might know which tool would be most appropriate for the frontend you've developed. I might even come to the conclusion that Flex was the right tool for the job. But then again, I might not. There are a lot of variables involved. It could be that Flex is better than Java for this particular task, but there are a dozen other options that would be even better. Maybe Flex works better for you because as a language it better suits the way you think, and for someone who thinks differently than you it would be a poor choice. This was kinda the whole point I was making. Unfortunately you didn't even feel the wind as it went right over your head. Some days all you can do is just shake your head and smile...
        • RE: Accept the Challenge

          It would be very interesting to see what a developer with your skills could do with WPF/E.
          Chingo Bling
    • I was referring specifically to the client side

      Server side is a different question. This article focuses on technologies "in and around the browser", i.e., on the client side in browser-based, desktop, and hybrid (webtop) applications.
      Ed Burnette
      • 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

    • I agree...

      It seems to me that we continue looking for the perfect "Holy Grail" platform for all scenarios. I got news, it ain't gonna happen. And while we're at it, why should it happen. Personally I always thought it was a bit of an advantage to having to know a few different languages/platforms. Every one is different, requiring a bit of a different mindset, and provides an opportunity for improving your skills.
    • Maybe it's just me, but

      I hate flash. It's installed on IE (a rarely used browser), but not on Firefox. As a rule, if a site requires flash, I just move on. Why? Because most of the flash I see has little's often a replacement for HTML pages, and I absolutely hate that. Furthermore, some sites have flash ads which are excessively annoying (and god help you if it's a forum and you open up many pages--see Hardocp's forums).

      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

    Yeah, Flash is better for all that flashy stuff - but IMHO, Java still rules for serious apps.
    • Can Java=flashy too?

      "Flash is better for all that flashy stuff"

      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).
      Ed Burnette
      • Flash not so flashy

        I would argue that the java user experience is much better than that of flash. Flash stuff have lots and lots of memory leaks and seam to hang the browser far more often than java applets.

        So, if they decide to make java flashy, then I hope they manages to avoid such problems.
    • Flash can be serious

      Flash can do stuff that Java can't even think of doing. And don't forget, Flash was origionally made for animation-Action Script was just an add-on for increased mobility. And for serious apps, I will give an example of saving and reading to files. In Java, you have to write a really complicated script for HTML transfer, but in Flash all you have to do is write a script in Perl for file IO (which is really easy), and call a single function in the Flash file.
      • Like?

        "Flash can do stuff that Java can't even think of doing."

        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?
      Duke E. Love
      • That seems to be the exception to the rule

        Yeah, look at any ad on any website. Or play one of those many Flash games or watch a Flash video. Yahoo Maps seems to be the exception to the rule - it's the only "serious" Flash applet I've encountered so far (although it's still pretty much flash, I prefer to use MapQuest for directions).

        Now that I've looked at a flashy map, I'll open NetBeans and do some real work . . .
        • You mean real work, like this?

          >>>it's the only "serious" Flash applet I've encountered so far

          You need to get out more.

          >> I'll open NetBeans and do some real work . .

          You mean do something like this?

          "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.
          Duke E. Love
  • I really don't like flash sites.

    Usually, I just want the information. I don't want to have to wait for dancing cows to load first.
    • Dancing cows

      ...are utterly beside the point. Flash can be used to create a simple, sober newspaper site also, without any distracting animation. There's also an argument to be made that the resulting system is more resource-efficient, more production-efficient re: programmer time, less likely to be buggy, faster loading, plays on more computers than Java apps do, etc. Because a lot of corporate project directors have opted to develop in Java for whatever reasons hardly supports it going forward.

      There are counter-arguments, of course, but throwing out images of "dancing cows" is a distraction in an otherwise important discussion.