Flash vs. Ajax

I’ve been hearing a lot of Flash vs. Ajax arguments lately, and unfortunately, they almost always start off in the wrong way.

It’s very common to hear people argue about Flash websites or RIAs vs. Ajax websites or RIAs, but this is always the wrong way to approach building any website. Would you have an argument with an architect about whether to build a house out of wood vs concrete? Of course not, they would use each material to build the parts of the house that the respective material is best for. Sometimes you might want to build a shack or barn out of all wood, sometimes you might want to build an all brick house, but many times you’ll want to use the best material for each section of the house. Build the foundation out of concrete, the walls and roof out of wood.

Websites and web applications should be treated the same way. Break things down to a component level and go from there. Use the right tool for each component. If you can do it well with HTML/Javascript, go for it. If it would work out better with Flash, then why waste time recreating something with Javascript that you could build 3 times faster with Flash? There are plenty of great examples of this today around the internet:

One of my favorite examples is Google Finance. They use HTML and Javascript for the stuff that is best suited for that, and then when they need to show a nice graph, they drop in a great interactive Flash graph and talk to it using Javascript as needed. The Flash controls the Javascript, and the Javascript can control the Flash as needed.

Another example is Flickr. They started out using Flash to display all of the images, including the image notes and the other toolbar options along with each image. While this might have been a good choice as the site started out, it was soon replaced by a more efficient HTML version of the toolbar and notes system that works just as well as the Flash version. They did end up keeping one small bit of Flash so users can rotate images and see a preview before they save it.

So the next time you start planning a website and you start thinking: “Hmm, Flash or Ajax?” Instead of looking at it from a site-wide perspective, try thinking about your site as a series of components, and then choose Flash or HTML/Javascript for each individual component instead.

27 thoughts on “Flash vs. Ajax

  1. Absolutely right – and so obvious when you see it written with such clarity. To me the problem is people come into a project thinking “I am a Flash Developer” or “I am an AJAX developer”, and go with the technology they know best. As you say, break the site down into components and use the best tool for the job each time.

  2. Very well said. It is a tool – both are tools – and they have their place with different pieces. Flash excels for video/audio presentations and are (in my opinion) the best tools to use for the job. However, there are other places where it might not be the best tool. It’s not that they are purely evil (AJAX/Flash) – it’s just that they have taken so much abuse.

  3. True, true. I also agree with Dom, that part of the reason people get so personally attached to one technology over the other is that it takes a big time investment to get skilled in either one. If you spent 3 years learning technology X, you are going to be more likely to use it wherever possible. It takes a higher level perspective to be able to objectively choose the best technology for the job.

  4. I think that’s exactly the point, good programmer stick to their “homie-language” for every project, better programmer take the language/technology appropriate for a project…

    but what hurts me most (it isn’t so dramatic as it sounds) with this whole everlasting battle between JS and Flash, that people from both camps try to put the other down…I think that’s soo stupid and unnecessary!

  5. I’m concerned about the scalability of an app that uses AJAX to talk to Flash and vice-versa. Once you have three or four major Flash pods inside an app, it may be a good idea to consider going all Flash. Cross-browser issues would ultimately inhibit an RIA made with both, as would the overhead of finding people to edit the Flash AND AJAX. From a practical point of view, there are advantages to using one or the other.

  6. I agree with Mike, and will add to it. I’m tired of the “use whichever tool is right for the job” mantra (although I agree with it), because that always seems to end up in Web 2.0 technology soup. 5 years ago the argument against Flash was about not requiring a proprietary plug-in. But if you’re already requiring the Flash player for a core piece of your RIA (ie Video), why throw in Ajax for teh sake of Ajax? Then again, if you can put Ajax as a bullet point, you’ll probably have a better chance of getting funded :)

    The point I want to make is that there continues to be more and more overlap between the two. Flash is getting better at handling text than it used to, and DHTML is making smoother and fancier animations than it used to. So “the right tool” may in fact be whichever you feel like using.

  7. Your blog defines the bg color but not the text color. As my default text color is white, this results in white-on-white text. Please add ‘color: #000000;’ to the body-element in your css.

  8. While I agree that it would be a bit daffed to build an extensive application trying to utilize Javascript/AJAX to communication with Flash, and vis-a-vis, I’m not sure that was the point which was trying to be made. “The right tool for the right job” means that you look at the scope of your over-arching project and determine what the business objectives are. If those objectives would be better suited for an all Flash application, then that might be the best route. If it’s AJAX, then so be it. Some, like the Google Financial app, are most suited to a hybrid version. So perhaps the mantra is actually inaccurate, and can be better stated in this way: “The right implementation to meet the business objectives”.

  9. You make a great point with Flickr but I think that Flash will win this cage match for photos and videos online because of the ease of use and that to me is what makes things on the web excel. Like WordPress for example the ease of use makes it a great blogging platform and adding widgets like Flickr are as easy as 1 2 3..

  10. “looking at it from a site-wide perspective”, so is it right. Make an interesting and handy site for your visitors. Different technics to different themes. We has it done here.

  11. Very well said. It is a tool – both are tools – and they have their place with different pieces. Flash excels for video/audio presentations and are (in my opinion) the best tools to use for the job. However, there are other places where it might not be the best tool. It’s not that they are purely evil (AJAX/Flash) – it’s just that they have taken so much abuse.

  12. Good point – why make your job any harder? I recently made a nice little calendar / date range chooser in Flash in about an hour – it would have taken forever in JS/HTML!

  13. I kind like flash, when I visit some website full of javascript, always have some error show up. and I can’t access that site at all!!
    And my browser will be very slow.
    so , flash is much better.

  14. Those who choose to take the “slights and disappointments” path, meanwhile, are very generously compensated for their trouble

Comments are closed.